diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-05-30 12:30:03 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-10 06:17:39 +0200 |
| commit | 56d71c2910a4e07512ca6bf80fe257bbfcc3265e (patch) | |
| tree | 404e0656a3da54cbf8e23d617406af9ea580d316 /src/test | |
| parent | 61a60ce7d369b54e209003e9e92bf90d6f5e5d4b (diff) | |
| download | rust-56d71c2910a4e07512ca6bf80fe257bbfcc3265e.tar.gz rust-56d71c2910a4e07512ca6bf80fe257bbfcc3265e.zip | |
Stabilize underscore_const_names.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/const_short_circuit.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/consts/const_short_circuit.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/consts/underscore_const_names.rs (renamed from src/test/ui/underscore_const_names.rs) | 5 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-underscore_const_names.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-underscore_const_names.stderr | 18 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/underscore_const_names_feature_gate.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/underscore_const_names_feature_gate.stderr | 12 |
7 files changed, 6 insertions, 56 deletions
diff --git a/src/test/ui/consts/const_short_circuit.rs b/src/test/ui/consts/const_short_circuit.rs index 1e7b7ed3193..87b14a11178 100644 --- a/src/test/ui/consts/const_short_circuit.rs +++ b/src/test/ui/consts/const_short_circuit.rs @@ -1,5 +1,3 @@ -#![feature(underscore_const_names)] - const _: bool = false && false; const _: bool = true && false; const _: bool = { diff --git a/src/test/ui/consts/const_short_circuit.stderr b/src/test/ui/consts/const_short_circuit.stderr index a67bb0b1b6d..0a6536c8837 100644 --- a/src/test/ui/consts/const_short_circuit.stderr +++ b/src/test/ui/consts/const_short_circuit.stderr @@ -1,23 +1,23 @@ error: new features like let bindings are not permitted in constants which also use short circuiting operators - --> $DIR/const_short_circuit.rs:6:9 + --> $DIR/const_short_circuit.rs:4:9 | LL | let mut x = true && false; | ^^^^^ | note: use of `&&` operator here does not actually short circuit due to the const evaluator presently not being able to do control flow. See https://github.com/rust-lang/rust/issues/49146 for more information. - --> $DIR/const_short_circuit.rs:6:22 + --> $DIR/const_short_circuit.rs:4:22 | LL | let mut x = true && false; | ^^ error: new features like let bindings are not permitted in constants which also use short circuiting operators - --> $DIR/const_short_circuit.rs:11:9 + --> $DIR/const_short_circuit.rs:9:9 | LL | let x = true && false; | ^ | note: use of `&&` operator here does not actually short circuit due to the const evaluator presently not being able to do control flow. See https://github.com/rust-lang/rust/issues/49146 for more information. - --> $DIR/const_short_circuit.rs:11:18 + --> $DIR/const_short_circuit.rs:9:18 | LL | let x = true && false; | ^^ diff --git a/src/test/ui/underscore_const_names.rs b/src/test/ui/consts/underscore_const_names.rs index 1db022e8862..8d57e5074f1 100644 --- a/src/test/ui/underscore_const_names.rs +++ b/src/test/ui/consts/underscore_const_names.rs @@ -1,9 +1,9 @@ // compile-pass -#![feature(underscore_const_names)] +#![deny(unused)] trait Trt {} -struct Str {} +pub struct Str {} impl Trt for Str {} macro_rules! check_impl { @@ -17,7 +17,6 @@ macro_rules! check_impl { } } -#[deny(unused)] const _ : () = (); const _ : i32 = 42; diff --git a/src/test/ui/feature-gates/feature-gate-underscore_const_names.rs b/src/test/ui/feature-gates/feature-gate-underscore_const_names.rs deleted file mode 100644 index 6b97c24a47e..00000000000 --- a/src/test/ui/feature-gates/feature-gate-underscore_const_names.rs +++ /dev/null @@ -1,14 +0,0 @@ -trait Trt {} -struct Str {} - -impl Trt for Str {} - -const _ : () = { -//~^ ERROR is unstable - use std::marker::PhantomData; - struct ImplementsTrait<T: Trt>(PhantomData<T>); - let _ = ImplementsTrait::<Str>(PhantomData); - () -}; - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-underscore_const_names.stderr b/src/test/ui/feature-gates/feature-gate-underscore_const_names.stderr deleted file mode 100644 index 8d925424d8c..00000000000 --- a/src/test/ui/feature-gates/feature-gate-underscore_const_names.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0658]: naming constants with `_` is unstable - --> $DIR/feature-gate-underscore_const_names.rs:6:1 - | -LL | / const _ : () = { -LL | | -LL | | use std::marker::PhantomData; -LL | | struct ImplementsTrait<T: Trt>(PhantomData<T>); -LL | | let _ = ImplementsTrait::<Str>(PhantomData); -LL | | () -LL | | }; - | |__^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/54912 - = help: add #![feature(underscore_const_names)] to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/underscore_const_names_feature_gate.rs b/src/test/ui/feature-gates/underscore_const_names_feature_gate.rs deleted file mode 100644 index e50bbf5b649..00000000000 --- a/src/test/ui/feature-gates/underscore_const_names_feature_gate.rs +++ /dev/null @@ -1,3 +0,0 @@ -const _: () = (); //~ ERROR is unstable - -fn main() {} diff --git a/src/test/ui/feature-gates/underscore_const_names_feature_gate.stderr b/src/test/ui/feature-gates/underscore_const_names_feature_gate.stderr deleted file mode 100644 index 0931145a6e2..00000000000 --- a/src/test/ui/feature-gates/underscore_const_names_feature_gate.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: naming constants with `_` is unstable - --> $DIR/underscore_const_names_feature_gate.rs:1:1 - | -LL | const _: () = (); - | ^^^^^^^^^^^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/54912 - = help: add #![feature(underscore_const_names)] to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. |
