-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
TAIT: typed patterns don't count as defining uses #113596
Copy link
Copy link
Open
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following code compiles successfully:
However, if
func3is commented out, then neitherfunc1norfunc2suffices 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