You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Type alias impl trait types do not check bounds apply to concrete type #73035
changed the title [-]Type alias impl trait types do check bounds apply to concrete type[/-][+]Type alias impl trait types do not check bounds apply to concrete type[/+]on Jun 5, 2020
For my understanding: the point is that values for X<'a> are only infered under the additional assumption 'a: 'static (from the signature of f), not for general 'a, so rust should complain about that before it allows you to use it as X::<'_>, correct?
This is tested in src/test/ui/type-alias-impl-trait/bounds-are-checked.rs already.
Ideally we would not allow f as a defining use because it overconstrains 'a, but it's hard to specify exactly what that means because not all of the (generic) parameters of the function have to be (generic) arguments of the opaque type.
Activity
[-]Type alias impl trait types do check bounds apply to concrete type[/-][+]Type alias impl trait types do not check bounds apply to concrete type[/+]matthewjasper commentedon Jun 29, 2020
The first example is UB so it may be target/optimization level dependent. This will be fixed once the ICE is gone.
3 remaining items
WorldSEnder commentedon Oct 3, 2020
For my understanding: the point is that values for
X<'a>are only infered under the additional assumption'a: 'static(from the signature off), not for general'a, so rust should complain about that before it allows you to use it asX::<'_>, correct?Aaron1011 commentedon Oct 6, 2020
Both of the examples in this issue now error with #73905 merged
matthewjasper commentedon Oct 6, 2020
This is tested in src/test/ui/type-alias-impl-trait/bounds-are-checked.rs already.
Ideally we would not allow
fas a defining use because it overconstrains'a, but it's hard to specify exactly what that means because not all of the (generic) parameters of the function have to be (generic) arguments of the opaque type.