about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-18 23:05:24 +0200
committerGitHub <noreply@github.com>2024-07-18 23:05:24 +0200
commitd1250bc1d53360184cc9dbebd385c3492a01e683 (patch)
tree8a3e5766b52fa3d7d75223a44425d11b4556f305 /compiler/rustc_pattern_analysis/src/errors.rs
parent11688370dd0467c78ac23f89029b2ba17156b000 (diff)
parentabf92c049dcdacdadb0a7f45426df30f2dbdb0dc (diff)
downloadrust-d1250bc1d53360184cc9dbebd385c3492a01e683.tar.gz
rust-d1250bc1d53360184cc9dbebd385c3492a01e683.zip
Rollup merge of #127929 - estebank:addr_of, r=compiler-errors
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_pattern_analysis/src/errors.rs')
0 files changed, 0 insertions, 0 deletions