-
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
Lifetime in trait method declaration affects RFC 1214 checks #27987
Comments
this is because
for this reason, predicates that contain lifetimes or type parameters can be used to satisfy themselves, while global predicates don't enter the where-clause list, and therefore correctly cause a warning. This is only an RFC1214 error because you did it in a trait method. Type-less predicates being allowed in trait/impl methods can indeed cause ICEs: pub struct S;
impl S {
pub fn f<'a>(&self, f: &'a f32) where u32: PartialEq<&'a f32> {
4==f;
}
}
fn main() {} |
/cc @rust-lang/lang |
This has to do w/ the early- vs late-bound lifetime distinction. I'd like to ease and remove that distinction, but it'll take more effort to get there. |
No it doesn't. Nothing changes if you force @eefriedman was surprised by the distinction in #28046 though. |
@arielb1 ah I see, yes, I stand corrected. |
I don't know what this means regarding the bug. |
The ICE was fixed by me in #42797, the "global predicate" thing is still present. |
Triage: This has been marked P-low for 6 years, and during that time has had no updates at all. Note in particular the lack of "duplicate of" or "I also have this problem" comments. It seems very unlikely this issue will ever get fixed. Rather than keeping this open forever, let's close it as "won't fix". |
Both function pass with I don't think we need this issue specifically to track such behaviour |
Currently, Test1 triggers an "error", but Test2 doesn't. I would expect them to be treated the same way.
The text was updated successfully, but these errors were encountered: