Commit 04be402
authored
Rollup merge of rust-lang#61825 - Centril:tauv-infer-fix, r=petrochenkov
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#49683File tree
2 files changed
+38
-5
lines changed- src
- librustc_typeck/check
- test/ui/type-alias-enum-variants
2 files changed
+38
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
297 | | - | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| |||
1055 | 1057 | | |
1056 | 1058 | | |
1057 | 1059 | | |
| 1060 | + | |
1058 | 1061 | | |
1059 | 1062 | | |
1060 | 1063 | | |
1061 | 1064 | | |
1062 | 1065 | | |
1063 | | - | |
1064 | | - | |
| 1066 | + | |
| 1067 | + | |
1065 | 1068 | | |
1066 | 1069 | | |
1067 | 1070 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments