]> git.proxmox.com Git - rustc.git/blame - src/test/ui/error-codes/E0017.stderr
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / ui / error-codes / E0017.stderr
CommitLineData
f035d41b 1error[E0764]: mutable references are not allowed in constants
60c5eb7d 2 --> $DIR/E0017.rs:5:30
2c00a5a8 3 |
532ac7d7 4LL | const CR: &'static mut i32 = &mut C;
f035d41b 5 | ^^^^^^ `&mut` is only allowed in `const fn`
2c00a5a8 6
60c5eb7d
XL
7error[E0019]: static contains unimplemented expression type
8 --> $DIR/E0017.rs:6:39
a1dfa0c6 9 |
532ac7d7 10LL | static STATIC_REF: &'static mut i32 = &mut X;
60c5eb7d 11 | ^^^^^^
f9f354fc
XL
12 |
13 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
a1dfa0c6 14
f035d41b 15error[E0764]: mutable references are not allowed in statics
60c5eb7d 16 --> $DIR/E0017.rs:6:39
2c00a5a8 17 |
532ac7d7 18LL | static STATIC_REF: &'static mut i32 = &mut X;
f035d41b 19 | ^^^^^^ `&mut` is only allowed in `const fn`
2c00a5a8 20
48663c56 21error[E0596]: cannot borrow immutable static item `X` as mutable
60c5eb7d 22 --> $DIR/E0017.rs:6:39
2c00a5a8 23 |
532ac7d7 24LL | static STATIC_REF: &'static mut i32 = &mut X;
48663c56 25 | ^^^^^^ cannot borrow as mutable
2c00a5a8 26
f035d41b 27error[E0764]: mutable references are not allowed in statics
60c5eb7d 28 --> $DIR/E0017.rs:9:38
2c00a5a8 29 |
532ac7d7 30LL | static CONST_REF: &'static mut i32 = &mut C;
f035d41b 31 | ^^^^^^ `&mut` is only allowed in `const fn`
60c5eb7d 32
f035d41b 33error[E0764]: mutable references are not allowed in statics
60c5eb7d
XL
34 --> $DIR/E0017.rs:10:52
35 |
36LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
f035d41b 37 | ^^^^^^ `&mut` is only allowed in `const fn`
2c00a5a8 38
60c5eb7d 39error: aborting due to 6 previous errors
2c00a5a8 40
f035d41b 41Some errors have detailed explanations: E0019, E0596, E0764.
60c5eb7d 42For more information about an error, try `rustc --explain E0019`.