1
Fork 0
rust/src
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
..
bootstrap bootstrap: fix warnings 2023-10-17 10:07:12 +03:00
ci Build GCC with support for BOLT 2023-10-09 21:46:14 +02:00
doc Rollup merge of #111072 - Urgau:check-cfg-new-syntax, r=petrochenkov 2023-10-17 19:07:21 +02:00
etc generate zsh autocompletion for x 2023-10-15 09:05:55 +03:00
librustdoc Auto merge of #116804 - matthiaskrgr:rollup-m2qm8ul, r=matthiaskrgr 2023-10-16 18:57:44 +00:00
llvm-project@d404cba4e3 Update LLVM submodule 2023-09-28 13:41:02 +02:00
rustdoc-json-types rustdoc-json: Rename typedef to type alias 2023-08-21 14:02:34 -07:00
tools Rollup merge of #116787 - a-lafrance:span-internal-lint, r=oli-obk 2023-10-17 19:07:23 +02:00
README.md
stage0.json Bump to latest beta 2023-10-08 19:57:43 -04:00
version Bump to 1.75.0 2023-09-30 19:09:22 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.