]>
Commit | Line | Data |
---|---|---|
f035d41b | 1 | error[E0764]: mutable references are not allowed in constants |
60c5eb7d | 2 | --> $DIR/E0017.rs:5:30 |
2c00a5a8 | 3 | | |
532ac7d7 | 4 | LL | const CR: &'static mut i32 = &mut C; |
f035d41b | 5 | | ^^^^^^ `&mut` is only allowed in `const fn` |
2c00a5a8 | 6 | |
60c5eb7d XL |
7 | error[E0019]: static contains unimplemented expression type |
8 | --> $DIR/E0017.rs:6:39 | |
a1dfa0c6 | 9 | | |
532ac7d7 | 10 | LL | 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 | 15 | error[E0764]: mutable references are not allowed in statics |
60c5eb7d | 16 | --> $DIR/E0017.rs:6:39 |
2c00a5a8 | 17 | | |
532ac7d7 | 18 | LL | static STATIC_REF: &'static mut i32 = &mut X; |
f035d41b | 19 | | ^^^^^^ `&mut` is only allowed in `const fn` |
2c00a5a8 | 20 | |
48663c56 | 21 | error[E0596]: cannot borrow immutable static item `X` as mutable |
60c5eb7d | 22 | --> $DIR/E0017.rs:6:39 |
2c00a5a8 | 23 | | |
532ac7d7 | 24 | LL | static STATIC_REF: &'static mut i32 = &mut X; |
48663c56 | 25 | | ^^^^^^ cannot borrow as mutable |
2c00a5a8 | 26 | |
f035d41b | 27 | error[E0764]: mutable references are not allowed in statics |
60c5eb7d | 28 | --> $DIR/E0017.rs:9:38 |
2c00a5a8 | 29 | | |
532ac7d7 | 30 | LL | static CONST_REF: &'static mut i32 = &mut C; |
f035d41b | 31 | | ^^^^^^ `&mut` is only allowed in `const fn` |
60c5eb7d | 32 | |
f035d41b | 33 | error[E0764]: mutable references are not allowed in statics |
60c5eb7d XL |
34 | --> $DIR/E0017.rs:10:52 |
35 | | | |
36 | LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; | |
f035d41b | 37 | | ^^^^^^ `&mut` is only allowed in `const fn` |
2c00a5a8 | 38 | |
60c5eb7d | 39 | error: aborting due to 6 previous errors |
2c00a5a8 | 40 | |
f035d41b | 41 | Some errors have detailed explanations: E0019, E0596, E0764. |
60c5eb7d | 42 | For more information about an error, try `rustc --explain E0019`. |