Commit f361413
committed
Auto merge of rust-lang#106399 - estebank:type-err-span-label, r=nagisa
Modify primary span label for E0308
Looking at the reactions to https://hachyderm.io/`@ekuber/109622160673605438,` a lot of people seem to have trouble understanding the current output, where the primary span label on type errors talks about the specific types that diverged, but these can be deeply nested type parameters. Because of that we could see "expected i32, found u32" in the label while the note said "expected Vec<i32>, found Vec<u32>". This understandably confuses people. I believe that once people learn to read these errors it starts to make more sense, but this PR changes the output to be more in line with what people might expect, without sacrificing terseness.
Fix rust-lang#68220.File tree
428 files changed
+1110
-1053
lines changed- compiler
- rustc_hir_analysis/src/check
- rustc_hir_typeck/src/method
- rustc_infer/src/infer/error_reporting
- rustc_middle/src/ty
- print
- rustc_trait_selection/src/traits
- error_reporting
- select
- src/tools/clippy/tests/ui
- tests
- run-make-fulldeps/type-mismatch-same-crate-name
- rustdoc-ui
- ui
- alloc-error
- argument-suggestions
- array-slice-vec
- associated-consts
- associated-type-bounds
- associated-types
- async-await
- in-trait
- issues
- autoref-autoderef
- blind
- block-result
- box
- c-variadic
- closures
- coercion
- compare-method
- confuse-field-and-method
- const-generics
- defaults
- generic_const_exprs
- issues
- consts
- const-eval
- cross
- deref-patterns
- destructuring-assignment
- diagnostic-width
- did_you_mean
- dst
- dyn-star
- empty
- error-codes
- extern
- feature-gates
- fmt
- fn
- fully-qualified-type
- function-pointer
- functions-closures
- generator
- generic-associated-types
- generics
- half-open-range-patterns
- higher-rank-trait-bounds
- impl-trait
- in-trait
- issues
- include-macros
- inference
- intrinsics
- issues
- issue-74236
- json
- kindck
- let-else
- lifetimes
- lint/must_not_suspend
- loops
- match
- methods
- issues
- mismatched_types
- mut
- never_type
- nll
- or-patterns
- parser
- issues
- pattern
- proc-macro
- range
- regions
- repeat-expr
- resolve
- return
- rfc-2005-default-binding-mode
- rfc-2008-non-exhaustive/uninhabited
- rfc-2294-if-let-guard
- rfc-2497-if-let-chains
- rfcs
- rfc-2396-target_feature-11
- rfc-2528-type-changing-struct-update
- self
- span
- specialization
- static
- structs
- str
- suggestions
- traits
- transmutability
- tuple
- type-alias-enum-variants
- type-alias-impl-trait
- type-inference
- typeck
- type
- type-check
- unboxed-closures
- unsized-locals
- unsized
- wf
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
428 files changed
+1110
-1053
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
284 | 298 | | |
285 | 299 | | |
286 | 300 | | |
| |||
319 | 333 | | |
320 | 334 | | |
321 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
322 | 344 | | |
323 | 345 | | |
324 | 346 | | |
| |||
826 | 848 | | |
827 | 849 | | |
828 | 850 | | |
829 | | - | |
| 851 | + | |
830 | 852 | | |
831 | 853 | | |
832 | 854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
1612 | 1613 | | |
1613 | 1614 | | |
1614 | 1615 | | |
1615 | | - | |
| 1616 | + | |
1616 | 1617 | | |
1617 | 1618 | | |
1618 | 1619 | | |
1619 | 1620 | | |
1620 | | - | |
| 1621 | + | |
1621 | 1622 | | |
1622 | 1623 | | |
1623 | 1624 | | |
1624 | | - | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1625 | 1641 | | |
1626 | 1642 | | |
1627 | 1643 | | |
| |||
1849 | 1865 | | |
1850 | 1866 | | |
1851 | 1867 | | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
1852 | 1880 | | |
1853 | 1881 | | |
1854 | 1882 | | |
| |||
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
392 | | - | |
| 399 | + | |
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
399 | | - | |
| 406 | + | |
400 | 407 | | |
401 | 408 | | |
402 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
0 commit comments