Commit 400b03a
authored
Rollup merge of #107098 - compiler-errors:pat-mismatch-fn-call, r=lcnr
Suggest function call on pattern type mismatch
Fixes #101208
This could definitely be generalized to support more suggestions in pattern matches. We can't use all of [`FnCtxt::emit_type_mismatch_suggestions`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#method.emit_type_mismatch_suggestions), but it's on my to-do list to play around with more suggestions that would be productive in this position.File tree
6 files changed
+68
-10
lines changed- compiler/rustc_hir_typeck/src
- fn_ctxt
- tests/ui/suggestions
6 files changed
+68
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
| 1333 | + | |
1334 | 1334 | | |
1335 | | - | |
| 1335 | + | |
1336 | 1336 | | |
1337 | | - | |
| 1337 | + | |
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
130 | | - | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
2146 | 2154 | | |
2147 | 2155 | | |
2148 | 2156 | | |
2149 | | - | |
| 2157 | + | |
| 2158 | + | |
2150 | 2159 | | |
2151 | 2160 | | |
2152 | 2161 | | |
| |||
| 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 | + | |
| 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 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments