rust/tests/ui/statics/issue-15261.stderr
许杰友 Jieyou Xu (Joe) 95ff642797 tests: remove //@ pretty-expanded usages
Done with

```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```

and

```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
2024-11-26 02:50:48 +08:00

17 lines
812 B
Plaintext

warning: creating a shared reference to mutable static is discouraged
--> $DIR/issue-15261.rs:8:37
|
LL | static n: &'static usize = unsafe { &n_mut };
| ^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
= note: `#[warn(static_mut_refs)]` on by default
help: use `&raw const` instead to create a raw pointer
|
LL | static n: &'static usize = unsafe { &raw const n_mut };
| ~~~~~~~~~~
warning: 1 warning emitted