rust/compiler/rustc_errors/src
Nicholas Nethercote 4225a1e186 Don't hash lints differently to non-lints.
`Diagnostic::keys`, which is used for hashing and equating diagnostics,
has a surprising behaviour: it ignores children, but only for lints.
This was added in #88493 to fix some duplicated diagnostics, but it
doesn't seem necessary any more.

This commit removes the special case and only four tests have changed
output, with additional errors. And those additional errors aren't
exact duplicates, they're just similar. For example, in
src/tools/clippy/tests/ui/same_name_method.rs we currently have this
error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:79:9
   |
LL |         impl T1 for S {}
   |         ^^^^^^^^^^^^^^^^
```
and with this change we also get this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:81:9
   |
LL |         impl T2 for S {}
   |         ^^^^^^^^^^^^^^^^
```
I think printing this second argument is reasonable, possibly even
preferable to hiding it. And the other cases are similar.
2024-01-31 08:25:29 +11:00
..
json Rename many DiagCtxt and EarlyDiagCtxt locals. 2023-12-18 16:06:22 +11:00
markdown apply fmt 2024-01-11 15:04:48 +03:00
annotate_snippet_emitter_writer.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
codes.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
diagnostic_builder.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
diagnostic_impls.rs Remove the lifetime from DiagnosticArgValue. 2024-01-30 18:46:06 +11:00
diagnostic.rs Don't hash lints differently to non-lints. 2024-01-31 08:25:29 +11:00
emitter.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
error.rs Make translate_message return result and add tests 2023-01-08 23:35:43 +01:00
json.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
lib.rs Rollup merge of #118533 - chenyukang:yukang-fix-118455, r=petrochenkov 2024-01-30 16:57:46 +01:00
lock.rs bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
registry.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
snippet.rs Create AnnotationColumn struct to fix hard tab column numbers in errors 2023-03-28 09:18:55 -04:00
styled_buffer.rs Replace some _ == _ || _ == _s with matches!(_, _ | _)s 2023-01-30 12:26:26 +00:00
tests.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
translation.rs Remove the second lifetime from DiagnosticArg. 2024-01-30 18:46:08 +11:00