11warning: attempting to modify a `const` item
2- --> $DIR/lint-const-item-mutation.rs:34 :5
2+ --> $DIR/lint-const-item-mutation.rs:35 :5
33 |
44LL | ARRAY[0] = 5;
55 | ^^^^^^^^^^^^
66 |
77 = note: `#[warn(const_item_mutation)]` on by default
8- = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified
8+ = note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
99note: `const` item defined here
1010 --> $DIR/lint-const-item-mutation.rs:26:1
1111 |
1212LL | const ARRAY: [u8; 1] = [25];
1313 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414
1515warning: attempting to modify a `const` item
16- --> $DIR/lint-const-item-mutation.rs:35 :5
16+ --> $DIR/lint-const-item-mutation.rs:36 :5
1717 |
1818LL | MY_STRUCT.field = false;
1919 | ^^^^^^^^^^^^^^^^^^^^^^^
2020 |
21- = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified
21+ = note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
2222note: `const` item defined here
2323 --> $DIR/lint-const-item-mutation.rs:27:1
2424 |
2525LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2727
2828warning: attempting to modify a `const` item
29- --> $DIR/lint-const-item-mutation.rs:36 :5
29+ --> $DIR/lint-const-item-mutation.rs:37 :5
3030 |
3131LL | MY_STRUCT.inner_array[0] = 'b';
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333 |
34- = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified
34+ = note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
3535note: `const` item defined here
3636 --> $DIR/lint-const-item-mutation.rs:27:1
3737 |
3838LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
3939 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040
4141warning: taking a mutable reference to a `const` item
42- --> $DIR/lint-const-item-mutation.rs:37 :5
42+ --> $DIR/lint-const-item-mutation.rs:38 :5
4343 |
4444LL | MY_STRUCT.use_mut();
4545 | ^^^^^^^^^^^^^^^^^^^
@@ -58,7 +58,7 @@ LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw
5858 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5959
6060warning: taking a mutable reference to a `const` item
61- --> $DIR/lint-const-item-mutation.rs:38 :5
61+ --> $DIR/lint-const-item-mutation.rs:39 :5
6262 |
6363LL | &mut MY_STRUCT;
6464 | ^^^^^^^^^^^^^^
@@ -72,7 +72,7 @@ LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7373
7474warning: taking a mutable reference to a `const` item
75- --> $DIR/lint-const-item-mutation.rs:39 :5
75+ --> $DIR/lint-const-item-mutation.rs:40 :5
7676 |
7777LL | (&mut MY_STRUCT).use_mut();
7878 | ^^^^^^^^^^^^^^^^
@@ -86,20 +86,20 @@ LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787
8888warning: attempting to modify a `const` item
89- --> $DIR/lint-const-item-mutation.rs:51 :5
89+ --> $DIR/lint-const-item-mutation.rs:52 :5
9090 |
9191LL | MUTABLE2.msg = "wow";
9292 | ^^^^^^^^^^^^^^^^^^^^
9393 |
94- = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified
94+ = note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
9595note: `const` item defined here
9696 --> $DIR/lint-const-item-mutation.rs:30:1
9797 |
9898LL | const MUTABLE2: Mutable2 = Mutable2 { msg: "", other: String::new() };
9999 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100100
101101warning: taking a mutable reference to a `const` item
102- --> $DIR/lint-const-item-mutation.rs:52 :5
102+ --> $DIR/lint-const-item-mutation.rs:53 :5
103103 |
104104LL | VEC.push(0);
105105 | ^^^^^^^^^^^
0 commit comments