about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-05 12:41:48 +0100
committerGitHub <noreply@github.com>2023-11-05 12:41:48 +0100
commita6605163346d7680502d8e2c1e5aaf1dc3229e41 (patch)
tree3284a938d55486ba6a78b4279eda41f30765cb72 /compiler/rustc_codegen_llvm/src
parent629ee74337ae7f6627d1d6b4a8588c49c233b4dd (diff)
parent65bec86b425b3580bba0b3eccdf44294d2baa88f (diff)
downloadrust-a6605163346d7680502d8e2c1e5aaf1dc3229e41.tar.gz
rust-a6605163346d7680502d8e2c1e5aaf1dc3229e41.zip
Rollup merge of #117596 - thomcc:core_macro_diag_items, r=Nilstrieb
Add diagnostic items for a few of core's builtin macros

Specifically, `env`, `option_env`, and `include`. There are a number of reasons why people might want to look at these in lints (For example, to ensure that things behave consistently, detect things that might make builds less reproducible, etc).

Concretely, in PL/Rust (well, `plrustc`) we have lints that forbid these (which I'd like to [add to clippy as restriction lints](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Landing.20a.20flotilla.20of.20lints.3F) eventually), and `dylint` also has [lints that look for `env!`/`option_env!`](https://github.com/trailofbits/dylint/blob/109a07e9f27a9651ef33b6677ccaddd21466e97a/examples/general/env_cargo_path/src/lib.rs) (although perhaps not `include`), which would benefit from this.

My experience is that it's pretty annoying to (robustly) check uses of builtin macros without these IME, although that's perhaps just my own fault (e.g. I could be doing it wrong).

At `@Nilstrieb's` suggestion, I've added a comment that explains why these are here, even though they are not used in the compiler. This is mostly to discourage removal, although it's not a big deal if it happens (I'm certainly not suggesting the presence of these be in any way stable).

---

In theory this is a library PR (in that it's in library/core), but I'm going to roll compiler because the existence of this or not is much more likely something they care about rather than libs. Hopefully nobody objects to this.

r? compiler
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions