-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
GAT + enum: incorrect unused lifetime error #69184
Comments
The variance code in ty::Projection(ref data) => {
let tcx = self.tcx();
self.add_constraints_from_trait_ref(current, data.trait_ref(tcx), variance);
} It seems to me that this is disregarding the substitutions for |
BTW how long do we need to keep this warning around? I understand that this is basically a given when using nightly features. (It puts me off using it in my normal build path — but presumably that's exactly what is wanted, in order to detect bugs like the one reported here.)
|
We only use |
On this topic, the following builds, trait Foo {}
impl<'a, T: A> Foo for T
where <T as A>::B<'a>: std::fmt::Debug
{} but the bound
|
Also, the following fails: trait Foo {}
impl<'a, T: A> Foo for T
where <T as A>::B<'a>: 'static
{} with:
This bound may not make much sense (since there is another lifetime parameter), but I believe it should be valid to specify here. |
I'm running into a similar issue which I believe is the same as this: (play) trait Bar{
type Foo<'a>: 'a;
}
struct What<'a, T: Bar> {
foo: T::Foo<'a>,
} |
This is a follow up on #67089, which now works. The following doesn't (play link):
Error is:
however, this lifetime clearly is used and is required.
The text was updated successfully, but these errors were encountered: