-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
non_lifetime_binders
falsely recognizes (and rejects) trait as lifetime
#119067
Comments
Right, this is a diagnostic bug and a current limitation of Obviously, we should say bounds cannot be used in this context instead (dropping the word lifetime). The diagnostic has simply never been updated after #![feature(closure_lifetime_binder)]
fn main() { let _ = for<T: Trait> || {}; } Secondly, higher-ranked bounds aren't supported yet. There's a draft PR, namely #115362, which is blocked on a performance run. |
@rustbot claim |
Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders fixes rust-lang#119067 Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context". ```rust #![allow(incomplete_features)] #![feature(non_lifetime_binders)] trait Trait {} trait Trait2 where for <T: Trait> ():{} //~^ ERROR bounds cannot be used in this context ```
Rollup merge of rust-lang#119154 - surechen:fix_119067, r=fmease Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders fixes rust-lang#119067 Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context". ```rust #![allow(incomplete_features)] #![feature(non_lifetime_binders)] trait Trait {} trait Trait2 where for <T: Trait> ():{} //~^ ERROR bounds cannot be used in this context ```
minimal repro:
output:
use case:
workaround:
rustc:
The text was updated successfully, but these errors were encountered: