-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix early param lifetimes in generic_const_exprs #118035
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
.or_else(|| self.give_name_if_anonymous_region_appears_in_arg_position_impl_trait(fr)); | ||
|
||
.or_else(|| self.give_name_if_anonymous_region_appears_in_arg_position_impl_trait(fr)) | ||
.or_else(|| self.give_name_if_anonymous_region_appears_in_early_param(fr)); |
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.
Not sure if this is the most efficient approach, since I don't ever think we expect this branch to be encountered unless we have a pre-existing error, at which point, suggestions are kinda moot in the first place.
Can we just handle the unwrap in #118021 more responsibly? We could perhaps just delay a bug, or report something a bit more vague, or just use unwrap_or_else(|| String::from("'_"))
.
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.
My initial solution was that but it felt kinda hacky, will do something similar thanks for suggestion!
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.
If you think it's hacky, then I can probably leave more feedback when I can see the changes implemented.
I just don't think we should implement something that looks like "good-path" code that we only expect to implement when errors are co-occurring.
Fix this, squash it into one commit, and please make the explanation comment a bit longer. r=me after. |
@bors r=compiler-errors |
Rollup of 6 pull requests Successful merges: - rust-lang#116085 (rustdoc-search: add support for traits and associated types) - rust-lang#117522 (Remove `--check-cfg` checking of command line `--cfg` args) - rust-lang#118029 (Expand Miri's BorTag GC to a Provenance GC) - rust-lang#118035 (Fix early param lifetimes in generic_const_exprs) - rust-lang#118083 (Remove i686-apple-darwin cross-testing) - rust-lang#118091 (Remove now deprecated target x86_64-sun-solaris.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118035 - ouz-a:november_ice2, r=compiler-errors Fix early param lifetimes in generic_const_exprs In cases like below, we never actually be able to capture region name for two reasons, first `'static` becomes anonymous lifetime and second we never capture region if it doesn't have a name so this results in ICE. ``` struct DataWrapper<'static> { data: &'a [u8; Self::SIZE], } impl DataWrapper<'a> { ``` Fixes rust-lang#118021
In cases like below, we never actually be able to capture region name for two reasons, first
'static
becomes anonymous lifetime and second we never capture region if it doesn't have a name so this results in ICE.Fixes #118021