rust/compiler/rustc_middle/src
许杰友 Jieyou Xu (Joe) f3faaf524c
Rollup merge of #134394 - dianne:clarify-pat-2024-migration, r=compiler-errors
Clarify the match ergonomics 2024 migration lint's output

This makes a few changes:
- Rather than using the whole pattern as a span for the lint, this collects spans for each problematic default binding mode reset and labels them with why they're problems.
- The lint's suggestions are now verbose-styled, so that it's clear what's being suggested vs. what's problematic.
- The wording is now less technical, and the hard error version of this diagnostic now links to the same reference material as the lint (currently an unwritten page of the edition guide).

I'm not totally confident in the wording or formatting, so I'd appreciate feedback on that in particular. I tried to draw a connection with word choice between the labels and the suggestion, but it might be imprecise, unclear, or cluttered. If so, it might be worth making the labels more terse and adding notes that explain them, but that's harder to read in a way too.

cc ```@Nadrieril``` ```@Jules-Bertholet```

Closes #133854. For reference, the error from that issue becomes:
```
error: pattern uses features incompatible with edition 2024
  --> $DIR/remove-me.rs:6:25
   |
LL |     map.iter().filter(|(&(_x, _y), &_c)| false);
   |                         ^          ^ cannot implicitly match against multiple layers of reference
   |                         |
   |                         cannot implicitly match against multiple layers of reference
   |
help: make the implied reference pattern explicit
   |
LL |     map.iter().filter(|&(&(_x, _y), &_c)| false);
   |                        +
```
2024-12-18 22:56:54 +08:00
..
dep_graph Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
hir Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
hooks Move some code from Compiler::enter to GlobalCtxt::finish 2024-11-09 17:55:39 +00:00
infer Remove associated type based effects logic 2024-10-24 09:46:36 +00:00
middle Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
mir mir: require is_cleanup when creating BasicBlockData 2024-12-18 20:43:54 +08:00
query Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
thir Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
traits Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
ty Rollup merge of #134394 - dianne:clarify-pat-2024-migration, r=compiler-errors 2024-12-18 22:56:54 +08:00
util Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
arena.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
error.rs Move some code from Compiler::enter to GlobalCtxt::finish 2024-11-09 17:55:39 +00:00
lib.rs move strict provenance lints to new feature gate, remove old feature gates 2024-10-21 15:22:17 +01:00
lint.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
macros.rs Improve const traits diagnostics for new desugaring 2024-10-02 19:45:17 +08:00
metadata.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
values.rs Rename ty_def_id so people will stop using it by accident 2024-12-13 16:36:38 +00:00