rust/tests/ui-fulldeps
Matthias Krüger 3ea438eb3a
Rollup merge of #116787 - a-lafrance:span-internal-lint, r=oli-obk
Implement an internal lint encouraging use of `Span::eq_ctxt`

Adds a new Rustc internal lint that forbids use of `.ctxt() == .ctxt()` for spans, encouraging use of `.eq_ctxt()` instead (see https://github.com/rust-lang/rust/issues/49509).

Also fixed a few violations of the lint in the Rustc codebase (a fun additional way I could test my code). Edit: MIR opt folks I believe that's why you're CC'ed, just a heads up.

Two things I'm not sure about:
1. The way I chose to detect calls to `Span::ctxt`. I know adding diagnostic items to methods is generally discouraged, but after some searching and experimenting I couldn't find anything else that worked, so I went with it. That said, I'm happy to implement something different if there's a better way out there. (For what it's worth, if there is a better way, it might be worth documenting in the rustc-dev-guide, which I'm happy to take care of)
2. The error message for the lint. Ideally it would probably be good to give some context as to why the suggestion is made (e.g. `rustc::default_hash_types` tells the user that it's because of performance), but I don't have that context so I couldn't put it in the error message. Happy to iterate on the error message based on feedback during review.

r? ``@oli-obk``
2023-10-17 19:07:23 +02:00
..
auxiliary
fluent-messages
internal-lints debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
mod_dir_simple
plugin Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
session-diagnostic Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
stable-mir Add MonoItems and Instance to stable_mir 2023-10-16 12:01:24 -07:00
compiler-calls.rs
deriving-global.rs
deriving-hygiene.rs
dropck_tarena_sound_drop.rs
dropck-tarena-cycle-checked.rs
dropck-tarena-cycle-checked.stderr
dropck-tarena-unsound-drop.rs
dropck-tarena-unsound-drop.stderr
empty-struct-braces-derive.rs
hash-stable-is-unstable.rs
hash-stable-is-unstable.stderr
lint-pass-macros.rs Remove rustc_lint_defs::lint_array 2023-09-28 23:01:25 +02:00
missing-rustc-driver-error.rs
missing-rustc-driver-error.stderr
mod_dir_path_canonicalized.rs
pathless-extern-unstable.rs
pathless-extern-unstable.stderr
pprust-expr-roundtrip.rs Update tools and fulldeps tests 2023-09-11 15:51:19 +00:00
regions-mock-tcx.rs
rustc_encodable_hygiene.rs