2024-03-26 04:35:38 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/static-no-inner-mut.rs:9:1
|
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.v: encountered `UnsafeCell` in read-only memory
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾ALLOC0╼ │ ╾──╼
}
2024-03-13 13:53:04 -05:00
error[E0080]: it is undefined behavior to use this value
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:12:1
2023-12-16 09:24:25 -06:00
|
2024-03-13 13:53:04 -05:00
LL | static REFMUT: &mut i32 = &mut 0;
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
2024-03-26 04:35:38 -05:00
╾ALLOC1╼ │ ╾──╼
2024-03-13 13:53:04 -05:00
}
2024-03-26 04:35:38 -05:00
error[E0080]: it is undefined behavior to use this value
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:16:1
2024-03-26 04:35:38 -05:00
|
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.v: encountered `UnsafeCell` in read-only memory
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾ALLOC2╼ │ ╾──╼
}
2024-03-13 13:53:04 -05:00
error[E0080]: it is undefined behavior to use this value
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:18:1
2024-03-13 13:53:04 -05:00
|
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
2024-03-26 04:35:38 -05:00
╾ALLOC3╼ │ ╾──╼
2024-03-13 13:53:04 -05:00
}
2023-12-16 09:24:25 -06:00
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:34:1
2023-12-16 09:24:25 -06:00
|
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13 13:53:04 -05:00
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
2024-03-26 04:46:30 -05:00
note: the lint level is defined here
--> $DIR/static-no-inner-mut.rs:6:9
|
LL | #![deny(const_eval_mutable_ptr_in_final_value)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-16 09:24:25 -06:00
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:38:1
2023-12-16 09:24:25 -06:00
|
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13 13:53:04 -05:00
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
2023-12-16 09:24:25 -06:00
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:42:1
2023-12-16 09:24:25 -06:00
|
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13 13:53:04 -05:00
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
2023-12-16 09:24:25 -06:00
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
--> $DIR/static-no-inner-mut.rs:9:26
|
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
| ^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:12:27
2023-12-16 09:24:25 -06:00
|
LL | static REFMUT: &mut i32 = &mut 0;
| ^^^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:16:56
2023-12-16 09:24:25 -06:00
|
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
| ^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:18:44
2023-12-16 09:24:25 -06:00
|
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
| ^^^^^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:34:52
2023-12-16 09:24:25 -06:00
|
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
| ^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:38:51
2023-12-16 09:24:25 -06:00
|
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
| ^^^^^^^
help: skipping check that does not even have a feature gate
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:42:52
2023-12-16 09:24:25 -06:00
|
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
| ^^^^^^
2024-03-26 04:46:30 -05:00
error: aborting due to 7 previous errors; 1 warning emitted
2024-03-13 13:53:04 -05:00
For more information about this error, try `rustc --explain E0080`.
Future incompatibility report: Future breakage diagnostic:
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:34:1
2024-03-13 13:53:04 -05:00
|
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
note: the lint level is defined here
--> $DIR/static-no-inner-mut.rs:6:9
|
LL | #![deny(const_eval_mutable_ptr_in_final_value)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic:
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:38:1
2024-03-13 13:53:04 -05:00
|
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
note: the lint level is defined here
--> $DIR/static-no-inner-mut.rs:6:9
|
LL | #![deny(const_eval_mutable_ptr_in_final_value)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic:
error: encountered mutable pointer in final value of static
2024-03-26 04:46:30 -05:00
--> $DIR/static-no-inner-mut.rs:42:1
2024-03-13 13:53:04 -05:00
|
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
note: the lint level is defined here
--> $DIR/static-no-inner-mut.rs:6:9
|
LL | #![deny(const_eval_mutable_ptr_in_final_value)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-16 09:24:25 -06:00