-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Avoid follow-up errors and ICEs after missing lifetime errors on data structures #127311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//! This test checks that we taint typeck results when there are | ||
//! error lifetimes, even though typeck doesn't actually care about lifetimes. | ||
|
||
struct Slice(&'reborrow [&'static [u8]]); | ||
//~^ ERROR undeclared lifetime | ||
|
||
static MAP: Slice = Slice(&[b"" as &'static [u8]]); | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0261]: use of undeclared lifetime name `'reborrow` | ||
--> $DIR/missing_lifetime.rs:4:15 | ||
| | ||
LL | struct Slice(&'reborrow [&'static [u8]]); | ||
| - ^^^^^^^^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'reborrow` here: `<'reborrow>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0261`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this could be done in a more targeted location to just fix this one specific kind of ICE, as long as there is no perf impact, this seems like a good place to check a lot of types for errors