-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
suggested fix for undeclared hrtb lifetimes in where clauses in produces error "[E0316] nested quantification of lifetimes" when specified just before the trait #122714
Comments
I think this should suggest : trait Trait<'b, T>
where T: for<'a> Trait<'b, T> + 'b { } Because |
@rustbot claim |
It already does suggest that, I think. There are two suggestions.
|
We should keep the preexisting - where T: for<'a> Trait<T> + 'b
+ where for<'a, 'b> T: Trait<T> + 'b removing the inner binder (which might be a bit harder to do). The outer binder to the left of the |
…in where clauses. fixes rust-lang#122714
…in where clauses. fixes rust-lang#122714
…in where clauses. fixes rust-lang#122714
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`. We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes fixes rust-lang#122714
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`. We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes fixes rust-lang#122714
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`. We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes fixes rust-lang#122714
Rollup merge of rust-lang#123122 - surechen:fix_122714, r=fmease Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`. We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes fixes rust-lang#122714
Code
Current output
Desired output
Rationale and extra context
HRTB lifetimes can be put not only before the constrained type (
for<...> T: ...
), but also just before the constraining trait (T: for<...> Trait ...
). When in this position, compiler suggests code which produces error "[E0316] nested quantification of lifetimes" as it ignores the existing HRTB just before the trait and only looks at constraint HRTB.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: