TAIT: typed patterns don't count as defining uses #113596
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-bug
Category: This is a bug.
F-type_alias_impl_trait
`#[feature(type_alias_impl_trait)]`
The following code compiles successfully:
However, if
func3
is commented out, then neitherfunc1
norfunc2
suffices to constrainTait
:It seems that the pattern only counts as actually constraining the type if one of the fields is actually destructured. The same behavior happens for tuple types; e.g.
let () = input;
does not constrain.Of course, it would be difficult for this to actually matter, since nothing ever produces a value of type
Tait
, so none of the functions can be called, but this might be a sign of a deeper problem (or just something to nail down about TAIT semantics), so I figured I'd report it anyway. I discovered it while minimizing #113594.Meta
rustc --version --verbose
:@rustbot label +A-impl-trait +F-type_alias_impl_trait
The text was updated successfully, but these errors were encountered: