forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122894 - compiler-errors:downgrade, r=lcnr
Move check for error in impl header outside of reporting Fixes rust-lang#121006 r? lcnr test location kinda sucks, can move it if needed
- Loading branch information
Showing
4 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/ui/coherence/skip-reporting-if-references-err.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/skip-reporting-if-references-err.rs:10:9 | ||
| | ||
LL | impl<T> ToUnit for T {} | ||
| ^^^^^^ expected lifetime parameter | ||
| | ||
help: indicate the anonymous lifetime | ||
| | ||
LL | impl<T> ToUnit<'_> for T {} | ||
| ++++ | ||
|
||
error[E0277]: the trait bound `for<'a> (): ToUnit<'a>` is not satisfied | ||
--> $DIR/skip-reporting-if-references-err.rs:15:29 | ||
| | ||
LL | impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `()` | ||
|
||
error[E0277]: the trait bound `for<'a> (): ToUnit<'a>` is not satisfied | ||
--> $DIR/skip-reporting-if-references-err.rs:15:18 | ||
| | ||
LL | impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0277, E0726. | ||
For more information about an error, try `rustc --explain E0277`. |
14 changes: 14 additions & 0 deletions
14
tests/ui/coherence/skip-reporting-if-references-err.next.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/skip-reporting-if-references-err.rs:10:9 | ||
| | ||
LL | impl<T> ToUnit for T {} | ||
| ^^^^^^ expected lifetime parameter | ||
| | ||
help: indicate the anonymous lifetime | ||
| | ||
LL | impl<T> ToUnit<'_> for T {} | ||
| ++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0726`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Regression test for #121006. | ||
//@ revisions: current next | ||
//@ ignore-compare-mode-next-solver (explicit revisions) | ||
//@[next] compile-flags: -Znext-solver | ||
|
||
trait ToUnit<'a> { | ||
type Unit; | ||
} | ||
|
||
impl<T> ToUnit for T {} | ||
//~^ ERROR implicit elided lifetime not allowed here | ||
|
||
trait Overlap {} | ||
impl<U> Overlap for fn(U) {} | ||
impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {} | ||
//[current]~^ ERROR the trait bound `for<'a> (): ToUnit<'a>` is not satisfied | ||
//[current]~| ERROR the trait bound `for<'a> (): ToUnit<'a>` is not satisfied | ||
|
||
fn main() {} |