Missing implied lifetime bounds for method with GAT in return position #102968
Labels
C-bug
Category: This is a bug.
F-generic_associated_types
`#![feature(generic_associated_types)]` a.k.a. GATs
T-types
Relevant to the types team, which will review and decide on the PR/issue.
The following example fails to compile:
The error message is:
This error message is a bit surprising, because the lifetime bounds are specified on the generic associated type:
type Bar<'bar> where 'foo: 'bar;
. I had expected that Rust would be able to automatically infer these bounds from the GAT declaration instead of giving an error. By using the information that the GAT is used in the return position, these implicit lifetime bounds could be automatically applied.If we explicitly spell out all the implicit bounds on `fn baz`, then it does compile:
p.s. I am on this Rust version
The text was updated successfully, but these errors were encountered: