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 Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
fluent-messages Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
internal-lints debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
mod_dir_simple Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
deriving-global.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
deriving-hygiene.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_tarena_sound_drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-tarena-cycle-checked.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-tarena-cycle-checked.stderr Fix fulldeps-ui tests 2023-01-15 19:57:32 +00:00
dropck-tarena-unsound-drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-tarena-unsound-drop.stderr Fix fulldeps-ui tests 2023-01-15 19:57:32 +00:00
empty-struct-braces-derive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
hash-stable-is-unstable.rs Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
hash-stable-is-unstable.stderr Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
lint-pass-macros.rs Remove rustc_lint_defs::lint_array 2023-09-28 23:01:25 +02:00
missing-rustc-driver-error.rs Don't depend on crate names in tests/ui-fulldeps/missing-rustc-driver-error.rs 2023-07-11 22:30:28 -05:00
missing-rustc-driver-error.stderr Don't depend on crate names in tests/ui-fulldeps/missing-rustc-driver-error.rs 2023-07-11 22:30:28 -05:00
mod_dir_path_canonicalized.rs various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
pathless-extern-unstable.rs Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
pathless-extern-unstable.stderr Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
pprust-expr-roundtrip.rs Update tools and fulldeps tests 2023-09-11 15:51:19 +00:00
regions-mock-tcx.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustc_encodable_hygiene.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00