-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow ReError in CanonicalUserTypeAnnotation
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 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
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 @@ | ||
// Regression test for #109072. | ||
// Check that we don't ICE when canonicalizing user annotation. | ||
|
||
trait Lt<'a> { | ||
type T; | ||
} | ||
|
||
impl Lt<'missing> for () { //~ ERROR undeclared lifetime | ||
type T = &'missing (); //~ ERROR undeclared lifetime | ||
} | ||
|
||
fn main() { | ||
let _: <() as Lt<'_>>::T = &(); | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/ui/nll/user-annotations/region-error-ice-109072.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,26 @@ | ||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/region-error-ice-109072.rs:8:9 | ||
| | ||
LL | impl Lt<'missing> for () { | ||
| - ^^^^^^^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'missing` here: `<'missing>` | ||
|
||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/region-error-ice-109072.rs:9:15 | ||
| | ||
LL | type T = &'missing (); | ||
| ^^^^^^^^ undeclared lifetime | ||
| | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | type T<'missing> = &'missing (); | ||
| ++++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | impl<'missing> Lt<'missing> for () { | ||
| ++++++++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0261`. |