about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-06 11:28:18 +0100
committerGitHub <noreply@github.com>2023-11-06 11:28:18 +0100
commit60dca87cff0af9dd3b3c5d1f4c08fccde11fd363 (patch)
treec407f07a55759c7311a44bba1d8e701cc1232329 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parentf9b644636f8c74d1d9a3283dc65a6a6f02a97718 (diff)
parent86fca873ba43ae6d74c4ff65b8fb036eb8c14bd1 (diff)
downloadrust-60dca87cff0af9dd3b3c5d1f4c08fccde11fd363.tar.gz
rust-60dca87cff0af9dd3b3c5d1f4c08fccde11fd363.zip
Rollup merge of #117592 - thomcc:env-span-wrong, r=davidtwco
Use the correct span when emitting the `env!` result

The span used for the `env!` resut changed in 1.73, due to https://github.com/rust-lang/rust/commit/75df62d4a2c45175b8cb1eb4bdc10fa423c11c4c (from https://github.com/rust-lang/rust/pull/114014).

This prevents [a lint in `plrustc`](https://github.com/tcdi/plrust/blob/main/plrustc/plrustc/src/lints/builtin_macros.rs#L54-L60)[^1] from working well, because the resulting span is not inside the  region where the lint is `#[deny()]`ed.

[^1]: Perhaps worth noting that the `env_macro` diagnostic item comes from [the std fork used with PL/Rust](https://github.com/tcdi/postgrestd/blob/rust-1.73.0/library/core/src/macros/mod.rs#L944).

Unfortunately, I have no idea how to write a test for this since I don't think we can have a custom lint in a test. A suggestion was made to use a custom proc macro for it, but that seems pretty involved (frankly, I might not have time to do it).

r? ``@davidtwco`` (since they're the author of the PR with the regression)

P.S. We generally try to avoid bothering upstream about PL/Rust-specific stuff (we don't want to nag), but this seems like an actual bug, since the other similar macros, such as `option_env` use the other span (and are lintable as a result).
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions