mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
remove unneeded flags; exlain why we still have const_if_match
This commit is contained in:
parent
f7f606d9af
commit
a909c039b5
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you
|
||||
#![feature(box_syntax)]
|
||||
#![allow(const_err)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// build-fail
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you
|
||||
#![allow(const_err)]
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you
|
||||
#![allow(const_err)]
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
@ -1,7 +1,8 @@
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you
|
||||
// aux-build:static_cross_crate.rs
|
||||
#![allow(const_err)]
|
||||
|
||||
// `const_if_match` is a HIR check and thus needed even when unleashed.
|
||||
#![feature(exclusive_range_pattern, half_open_range_patterns, const_if_match)]
|
||||
|
||||
extern crate static_cross_crate;
|
||||
@ -38,6 +39,7 @@ pub fn test(x: &[u8; 1]) -> bool {
|
||||
match x {
|
||||
SLICE_MUT => true,
|
||||
//~^ ERROR could not evaluate constant pattern
|
||||
//~| ERROR could not evaluate constant pattern
|
||||
&[1..] => false,
|
||||
}
|
||||
}
|
||||
@ -46,6 +48,7 @@ pub fn test2(x: &u8) -> bool {
|
||||
match x {
|
||||
U8_MUT => true,
|
||||
//~^ ERROR could not evaluate constant pattern
|
||||
//~| ERROR could not evaluate constant pattern
|
||||
&(1..) => false,
|
||||
}
|
||||
}
|
||||
@ -56,6 +59,7 @@ pub fn test3(x: &u8) -> bool {
|
||||
match x {
|
||||
U8_MUT2 => true,
|
||||
//~^ ERROR could not evaluate constant pattern
|
||||
//~| ERROR could not evaluate constant pattern
|
||||
&(1..) => false,
|
||||
}
|
||||
}
|
||||
@ -63,6 +67,7 @@ pub fn test4(x: &u8) -> bool {
|
||||
match x {
|
||||
U8_MUT3 => true,
|
||||
//~^ ERROR could not evaluate constant pattern
|
||||
//~| ERROR could not evaluate constant pattern
|
||||
&(1..) => false,
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0080]: it is undefined behavior to use this value
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:11:1
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:12:1
|
||||
|
|
||||
LL | / const SLICE_MUT: &[u8; 1] = {
|
||||
LL | |
|
||||
@ -11,13 +11,13 @@ LL | | };
|
||||
= 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.
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:39: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:17:1
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:18:1
|
||||
|
|
||||
LL | / const U8_MUT: &u8 = {
|
||||
LL | |
|
||||
@ -29,13 +29,13 @@ LL | | };
|
||||
= 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.
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:47: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:26:14
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:27:14
|
||||
|
|
||||
LL | / const U8_MUT2: &u8 = {
|
||||
LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
|
||||
@ -46,19 +46,19 @@ LL | | };
|
||||
| |__-
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:24:8
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:25:8
|
||||
|
|
||||
LL | #[warn(const_err)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:57: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:32:51
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33:51
|
||||
|
|
||||
LL | / const U8_MUT3: &u8 = {
|
||||
LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
|
||||
@ -69,13 +69,37 @@ LL | | };
|
||||
| |__-
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:31:8
|
||||
|
|
||||
LL | #[warn(const_err)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:64: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:40:9
|
||||
|
|
||||
LL | SLICE_MUT => true,
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $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:60:9
|
||||
|
|
||||
LL | U8_MUT2 => true,
|
||||
| ^^^^^^^
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:68:9
|
||||
|
|
||||
LL | U8_MUT3 => true,
|
||||
| ^^^^^^^
|
||||
@ -83,62 +107,62 @@ 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:14:15
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:15: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:14:15
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:15: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:20:15
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:21: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:20:15
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:21: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:20:15
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:21: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:26:17
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:27: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:32:20
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33: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:32:20
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33: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:32:20
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33: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:32:77
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33: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:32:20
|
||||
--> $DIR/const_refers_to_static_cross_crate.rs:33:20
|
||||
|
|
||||
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors; 3 warnings emitted
|
||||
error: aborting due to 10 previous errors; 3 warnings emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics
|
||||
// compile-flags: -Zunleash-the-miri-inside-of-you
|
||||
// normalize-stderr-test "alloc[0-9]+" -> "allocN"
|
||||
|
||||
#![deny(const_err)] // The `allow` variant is tested by `mutable_const2`.
|
||||
|
Loading…
Reference in New Issue
Block a user