1
1
error[E0080]: it is undefined behavior to use this value
2
- --> $DIR/static-no-inner-mut.rs:9 :1
2
+ --> $DIR/static-no-inner-mut.rs:8 :1
3
3
|
4
4
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.v: encountered `UnsafeCell` in read-only memory
@@ -10,7 +10,7 @@ LL | static REF: &AtomicI32 = &AtomicI32::new(42);
10
10
}
11
11
12
12
error[E0080]: it is undefined behavior to use this value
13
- --> $DIR/static-no-inner-mut.rs:12 :1
13
+ --> $DIR/static-no-inner-mut.rs:11 :1
14
14
|
15
15
LL | static REFMUT: &mut i32 = &mut 0;
16
16
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -21,7 +21,7 @@ LL | static REFMUT: &mut i32 = &mut 0;
21
21
}
22
22
23
23
error[E0080]: it is undefined behavior to use this value
24
- --> $DIR/static-no-inner-mut.rs:16 :1
24
+ --> $DIR/static-no-inner-mut.rs:15 :1
25
25
|
26
26
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
27
27
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.v: encountered `UnsafeCell` in read-only memory
@@ -32,7 +32,7 @@ LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
32
32
}
33
33
34
34
error[E0080]: it is undefined behavior to use this value
35
- --> $DIR/static-no-inner-mut.rs:18 :1
35
+ --> $DIR/static-no-inner-mut.rs:17 :1
36
36
|
37
37
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -45,118 +45,53 @@ LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
45
45
error: encountered mutable pointer in final value of static
46
46
--> $DIR/static-no-inner-mut.rs:34:1
47
47
|
48
- LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
49
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
- |
51
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
52
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
53
- note: the lint level is defined here
54
- --> $DIR/static-no-inner-mut.rs:6:9
55
- |
56
- LL | #![deny(const_eval_mutable_ptr_in_final_value)]
57
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
-
59
- error: encountered mutable pointer in final value of static
60
- --> $DIR/static-no-inner-mut.rs:38:1
61
- |
62
48
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
63
49
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64
- |
65
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
66
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
67
50
68
51
error: encountered mutable pointer in final value of static
69
- --> $DIR/static-no-inner-mut.rs:42 :1
52
+ --> $DIR/static-no-inner-mut.rs:37 :1
70
53
|
71
54
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
72
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73
- |
74
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
75
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
76
56
77
57
warning: skipping const checks
78
58
|
79
59
help: skipping check that does not even have a feature gate
80
- --> $DIR/static-no-inner-mut.rs:9 :26
60
+ --> $DIR/static-no-inner-mut.rs:8 :26
81
61
|
82
62
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
83
63
| ^^^^^^^^^^^^^^^^^^^
84
64
help: skipping check that does not even have a feature gate
85
- --> $DIR/static-no-inner-mut.rs:12 :27
65
+ --> $DIR/static-no-inner-mut.rs:11 :27
86
66
|
87
67
LL | static REFMUT: &mut i32 = &mut 0;
88
68
| ^^^^^^
89
69
help: skipping check that does not even have a feature gate
90
- --> $DIR/static-no-inner-mut.rs:16 :56
70
+ --> $DIR/static-no-inner-mut.rs:15 :56
91
71
|
92
72
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
93
73
| ^^^^
94
74
help: skipping check that does not even have a feature gate
95
- --> $DIR/static-no-inner-mut.rs:18 :44
75
+ --> $DIR/static-no-inner-mut.rs:17 :44
96
76
|
97
77
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
98
78
| ^^^^^^^^
99
79
help: skipping check that does not even have a feature gate
100
- --> $DIR/static-no-inner-mut.rs:34 :52
80
+ --> $DIR/static-no-inner-mut.rs:31 :52
101
81
|
102
82
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
103
83
| ^^^^^^^^^^^^^^^^^^^
104
84
help: skipping check that does not even have a feature gate
105
- --> $DIR/static-no-inner-mut.rs:38 :51
85
+ --> $DIR/static-no-inner-mut.rs:34 :51
106
86
|
107
87
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
108
88
| ^^^^^^^
109
89
help: skipping check that does not even have a feature gate
110
- --> $DIR/static-no-inner-mut.rs:42 :52
90
+ --> $DIR/static-no-inner-mut.rs:37 :52
111
91
|
112
92
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
113
93
| ^^^^^^
114
94
115
- error: aborting due to 7 previous errors; 1 warning emitted
95
+ error: aborting due to 6 previous errors; 1 warning emitted
116
96
117
97
For more information about this error, try `rustc --explain E0080`.
118
- Future incompatibility report: Future breakage diagnostic:
119
- error: encountered mutable pointer in final value of static
120
- --> $DIR/static-no-inner-mut.rs:34:1
121
- |
122
- LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
123
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124
- |
125
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
126
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
127
- note: the lint level is defined here
128
- --> $DIR/static-no-inner-mut.rs:6:9
129
- |
130
- LL | #![deny(const_eval_mutable_ptr_in_final_value)]
131
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
-
133
- Future breakage diagnostic:
134
- error: encountered mutable pointer in final value of static
135
- --> $DIR/static-no-inner-mut.rs:38:1
136
- |
137
- LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
138
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
- |
140
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
141
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
142
- note: the lint level is defined here
143
- --> $DIR/static-no-inner-mut.rs:6:9
144
- |
145
- LL | #![deny(const_eval_mutable_ptr_in_final_value)]
146
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147
-
148
- Future breakage diagnostic:
149
- error: encountered mutable pointer in final value of static
150
- --> $DIR/static-no-inner-mut.rs:42:1
151
- |
152
- LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
153
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154
- |
155
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
156
- = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
157
- note: the lint level is defined here
158
- --> $DIR/static-no-inner-mut.rs:6:9
159
- |
160
- LL | #![deny(const_eval_mutable_ptr_in_final_value)]
161
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
162
-
0 commit comments