about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-11 20:12:48 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-07-18 18:39:20 +0000
commitabf92c049dcdacdadb0a7f45426df30f2dbdb0dc (patch)
tree9b8efeff3dd8359044b220090c050039d2107171 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent5753b3067662e17a69b54b9418dbc37b73769a84 (diff)
downloadrust-abf92c049dcdacdadb0a7f45426df30f2dbdb0dc.tar.gz
rust-abf92c049dcdacdadb0a7f45426df30f2dbdb0dc.zip
Use more accurate span for `addr_of!` suggestion
Use a multipart suggestion instead of a single whole-span replacement:

```
error[E0796]: creating a shared reference to a mutable static
  --> $DIR/reference-to-mut-static-unsafe-fn.rs:10:18
   |
LL |         let _y = &X;
   |                  ^^ shared reference to mutable static
   |
   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
help: use `addr_of!` instead to create a raw pointer
   |
LL |         let _y = addr_of!(X);
   |                  ~~~~~~~~~ +
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions