-
Notifications
You must be signed in to change notification settings - Fork 13.3k
improve case with both anonymous lifetime parameters #43269
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
cc #42516 -- I believe @gaurikholkar is already pretty far along in this particular patch. |
improve case with both anonymous lifetime parameters #43269 This is a fix to #43269. Sample output message- ``` error[E0623]: lifetime mismatch --> $DIR/ex3-both-anon-regions.rs:12:12 | 11 | fn foo(x: &mut Vec<&u8>, y: &u8) { | --- --- these references must have the same lifetime 12 | x.push(y); | ^ data from `y` flows into `x` here error: aborting due to 2 previous errors ``` r? @nikomatsakis
So I was talking to @aturon and @jonathandturner and they both mentioned that the current message feels a bit confused to them. @jonathandturner turner wrote (hope he doesn't mind me quoting), "my naive brain goes 'can't the compiler magic up the constraint that the lifetimes match if it's inferring them anyway?'" Anyway, I was thinking that it might be an improvement to change the wording to:
|
Opened up a PR #43541 |
Working on this now #43877 |
This works now, no? Closing. |
Address the case where both the regions are anonymous.
Driving example for this case is
cc @nikomatsakis
The text was updated successfully, but these errors were encountered: