fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB66 linesraw
1warning: taking a mutable reference to a `const` item
2  --> $DIR/E0388.rs:4:30
3   |
4LL | const CR: &'static mut i32 = &mut C;
5   |                              ^^^^^^
6   |
7   = note: each usage of a `const` item creates a new temporary
8   = note: the mutable reference will refer to this temporary, not the original `const` item
9note: `const` item defined here
10  --> $DIR/E0388.rs:2:1
11   |
12LL | const C: i32 = 2;
13   | ^^^^^^^^^^^^
14   = note: `#[warn(const_item_mutation)]` on by default
15
16error[E0764]: mutable references are not allowed in the final value of constants
17  --> $DIR/E0388.rs:4:30
18   |
19LL | const CR: &'static mut i32 = &mut C;
20   |                              ^^^^^^
21
22error[E0658]: mutation through a reference is not allowed in statics
23  --> $DIR/E0388.rs:6:39
24   |
25LL | static STATIC_REF: &'static mut i32 = &mut X;
26   |                                       ^^^^^^
27   |
28   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
29   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
30
31error[E0764]: mutable references are not allowed in the final value of statics
32  --> $DIR/E0388.rs:6:39
33   |
34LL | static STATIC_REF: &'static mut i32 = &mut X;
35   |                                       ^^^^^^
36
37error[E0596]: cannot borrow immutable static item `X` as mutable
38  --> $DIR/E0388.rs:6:39
39   |
40LL | static STATIC_REF: &'static mut i32 = &mut X;
41   |                                       ^^^^^^ cannot borrow as mutable
42
43warning: taking a mutable reference to a `const` item
44  --> $DIR/E0388.rs:10:38
45   |
46LL | static CONST_REF: &'static mut i32 = &mut C;
47   |                                      ^^^^^^
48   |
49   = note: each usage of a `const` item creates a new temporary
50   = note: the mutable reference will refer to this temporary, not the original `const` item
51note: `const` item defined here
52  --> $DIR/E0388.rs:2:1
53   |
54LL | const C: i32 = 2;
55   | ^^^^^^^^^^^^
56
57error[E0764]: mutable references are not allowed in the final value of statics
58  --> $DIR/E0388.rs:10:38
59   |
60LL | static CONST_REF: &'static mut i32 = &mut C;
61   |                                      ^^^^^^
62
63error: aborting due to 5 previous errors; 2 warnings emitted
64
65Some errors have detailed explanations: E0596, E0658, E0764.
66For more information about an error, try `rustc --explain E0596`.