Skip to content

Commit

Permalink
32bit bless
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 15, 2021
1 parent 8af76cb commit 70c1cf1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ error[E0080]: it is undefined behavior to use this value
|
LL | / const REF_INTERIOR_MUT: &usize = {
LL | |
LL | |
LL | |
LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
LL | | unsafe { &*(&FOO as *const _ as *const usize) }
LL | | };
Expand All @@ -16,12 +14,10 @@ LL | | };
}

error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static2.rs:20:1
--> $DIR/const_refers_to_static2.rs:18:1
|
LL | / const READ_IMMUT: &usize = {
LL | |
LL | |
LL | |
LL | | static FOO: usize = 0;
LL | | &FOO
LL | | };
Expand All @@ -35,17 +31,17 @@ LL | | };
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static2.rs:16:18
--> $DIR/const_refers_to_static2.rs:14:18
|
LL | unsafe { &*(&FOO as *const _ as *const usize) }
| ^^^
help: skipping check for `const_raw_ptr_deref` feature
--> $DIR/const_refers_to_static2.rs:16:14
--> $DIR/const_refers_to_static2.rs:14:14
|
LL | unsafe { &*(&FOO as *const _ as *const usize) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static2.rs:25:6
--> $DIR/const_refers_to_static2.rs:21:6
|
LL | &FOO
| ^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ error[E0080]: it is undefined behavior to use this value
|
LL | / const SLICE_MUT: &[u8; 1] = {
LL | |
LL | |
LL | |
LL | | unsafe { &static_cross_crate::ZERO }
LL | | };
| |__^ type validation failed: encountered a reference pointing to a static variable
Expand All @@ -15,18 +13,16 @@ LL | | };
}

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:47:9
--> $DIR/const_refers_to_static_cross_crate.rs:40:9
|
LL | SLICE_MUT => true,
| ^^^^^^^^^

error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static_cross_crate.rs:19:1
--> $DIR/const_refers_to_static_cross_crate.rs:17:1
|
LL | / const U8_MUT: &u8 = {
LL | |
LL | |
LL | |
LL | | unsafe { &static_cross_crate::ZERO[0] }
LL | | };
| |__^ type validation failed: encountered a reference pointing to a static variable
Expand All @@ -37,143 +33,141 @@ LL | | };
}

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:56:9
--> $DIR/const_refers_to_static_cross_crate.rs:49:9
|
LL | U8_MUT => true,
| ^^^^^^

warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:29:15
--> $DIR/const_refers_to_static_cross_crate.rs:25:15
|
LL | / const U8_MUT2: &u8 = {
LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
LL | |
LL | |
LL | |
LL | |
LL | | };
| |__-
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:27:8
--> $DIR/const_refers_to_static_cross_crate.rs:23:8
|
LL | #[warn(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:67:9
--> $DIR/const_refers_to_static_cross_crate.rs:60:9
|
LL | U8_MUT2 => true,
| ^^^^^^^

warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:37:51
--> $DIR/const_refers_to_static_cross_crate.rs:32:51
|
LL | / const U8_MUT3: &u8 = {
LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| | ^^^^^^^^^^^ constant accesses static
LL | |
LL | |
... |
LL | |
LL | | };
| |__-
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:35:8
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
|
LL | #[warn(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:75:9
--> $DIR/const_refers_to_static_cross_crate.rs:68:9
|
LL | U8_MUT3 => true,
| ^^^^^^^

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:47:9
--> $DIR/const_refers_to_static_cross_crate.rs:40:9
|
LL | SLICE_MUT => true,
| ^^^^^^^^^

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:56:9
--> $DIR/const_refers_to_static_cross_crate.rs:49:9
|
LL | U8_MUT => true,
| ^^^^^^

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:67:9
--> $DIR/const_refers_to_static_cross_crate.rs:60:9
|
LL | U8_MUT2 => true,
| ^^^^^^^

error: could not evaluate constant pattern
--> $DIR/const_refers_to_static_cross_crate.rs:75:9
--> $DIR/const_refers_to_static_cross_crate.rs:68:9
|
LL | U8_MUT3 => true,
| ^^^^^^^

warning: skipping const checks
|
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:16:15
--> $DIR/const_refers_to_static_cross_crate.rs:14:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:16:15
--> $DIR/const_refers_to_static_cross_crate.rs:14:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:23:15
--> $DIR/const_refers_to_static_cross_crate.rs:19:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:23:15
--> $DIR/const_refers_to_static_cross_crate.rs:19:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:23:15
--> $DIR/const_refers_to_static_cross_crate.rs:19:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:29:17
--> $DIR/const_refers_to_static_cross_crate.rs:25:17
|
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:37:20
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:37:20
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:37:20
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check for `const_panic` feature
--> $DIR/const_refers_to_static_cross_crate.rs:37:77
--> $DIR/const_refers_to_static_cross_crate.rs:32:77
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^
help: skipping check that does not even have a feature gate
--> $DIR/const_refers_to_static_cross_crate.rs:37:20
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 70c1cf1

Please sign in to comment.