|
| 1 | +warning: creating a shared reference to mutable static is discouraged |
| 2 | + --> $DIR/static-issue-17302.rs:11:18 |
| 3 | + | |
| 4 | +LL | unsafe { DROPPED[i] = true; } |
| 5 | + | ^^^^^^^^^^ shared reference to mutable static |
| 6 | + | |
| 7 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 8 | + = note: this will be a hard error in the 2024 edition |
| 9 | + = 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 |
| 10 | + = note: `#[warn(static_mut_refs)]` on by default |
| 11 | + |
| 12 | +warning: creating a shared reference to mutable static is discouraged |
| 13 | + --> $DIR/static-issue-17302.rs:24:17 |
| 14 | + | |
| 15 | +LL | assert!(DROPPED[0]); |
| 16 | + | ^^^^^^^^^^ shared reference to mutable static |
| 17 | + | |
| 18 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 19 | + = note: this will be a hard error in the 2024 edition |
| 20 | + = 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 |
| 21 | + |
| 22 | +warning: creating a shared reference to mutable static is discouraged |
| 23 | + --> $DIR/static-issue-17302.rs:26:17 |
| 24 | + | |
| 25 | +LL | assert!(DROPPED[1]); |
| 26 | + | ^^^^^^^^^^ shared reference to mutable static |
| 27 | + | |
| 28 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 29 | + = note: this will be a hard error in the 2024 edition |
| 30 | + = 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 |
| 31 | + |
| 32 | +warning: 3 warnings emitted |
| 33 | + |
0 commit comments