1
- error[E0658 ]: references in constants may only refer to immutable values
1
+ error[E0764 ]: mutable references are not allowed in constants
2
2
--> $DIR/E0017.rs:5:30
3
3
|
4
4
LL | const CR: &'static mut i32 = &mut C;
5
- | ^^^^^^ constants require immutable values
6
- |
7
- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8
- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
5
+ | ^^^^^^ `&mut` is only allowed in `const fn`
9
6
10
7
error[E0019]: static contains unimplemented expression type
11
8
--> $DIR/E0017.rs:6:39
@@ -15,40 +12,31 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
15
12
|
16
13
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
17
14
18
- error[E0658 ]: references in statics may only refer to immutable values
15
+ error[E0764 ]: mutable references are not allowed in statics
19
16
--> $DIR/E0017.rs:6:39
20
17
|
21
18
LL | static STATIC_REF: &'static mut i32 = &mut X;
22
- | ^^^^^^ statics require immutable values
23
- |
24
- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
25
- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
19
+ | ^^^^^^ `&mut` is only allowed in `const fn`
26
20
27
21
error[E0596]: cannot borrow immutable static item `X` as mutable
28
22
--> $DIR/E0017.rs:6:39
29
23
|
30
24
LL | static STATIC_REF: &'static mut i32 = &mut X;
31
25
| ^^^^^^ cannot borrow as mutable
32
26
33
- error[E0658 ]: references in statics may only refer to immutable values
27
+ error[E0764 ]: mutable references are not allowed in statics
34
28
--> $DIR/E0017.rs:9:38
35
29
|
36
30
LL | static CONST_REF: &'static mut i32 = &mut C;
37
- | ^^^^^^ statics require immutable values
38
- |
39
- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
40
- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
31
+ | ^^^^^^ `&mut` is only allowed in `const fn`
41
32
42
- error[E0658 ]: references in statics may only refer to immutable values
33
+ error[E0764 ]: mutable references are not allowed in statics
43
34
--> $DIR/E0017.rs:10:52
44
35
|
45
36
LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
46
- | ^^^^^^ statics require immutable values
47
- |
48
- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
49
- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
37
+ | ^^^^^^ `&mut` is only allowed in `const fn`
50
38
51
39
error: aborting due to 6 previous errors
52
40
53
- Some errors have detailed explanations: E0019, E0596, E0658 .
41
+ Some errors have detailed explanations: E0019, E0596, E0764 .
54
42
For more information about an error, try `rustc --explain E0019`.
0 commit comments