-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
#![feature(type_alias_enum_variants)]: Unit variant pattern through a type alias to generic enum requires type annotations #61801
Comments
It might be a good idea to trace the difference between |
Value (
Rather |
type_alias_enum_variants: fix #61801; allow a path pattern to infer Fix #61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc #61682 cc #49683
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer Fix rust-lang#61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc rust-lang#61682 cc rust-lang#49683
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer Fix rust-lang#61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc rust-lang#61682 cc rust-lang#49683
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer Fix rust-lang#61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc rust-lang#61682 cc rust-lang#49683
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer Fix rust-lang#61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc rust-lang#61682 cc rust-lang#49683
type_alias_enum_variants: fix #61801; allow a path pattern to infer Fix #61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc #61682 cc #49683
The following, which I expect to work, fails to infer the type of
OptAlias::None
:In HIR,
OptAlias::None
should correspond to:However, if we change the snippet to:
it all works out fine.
I also tested changing
None
to a tuple variant and that works also.cc @petrochenkov @eddyb @alexreg
cc #61682
The text was updated successfully, but these errors were encountered: