diff options
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r-- | tests/ui/error-codes/E0004.stderr | 2 | ||||
-rw-r--r-- | tests/ui/error-codes/E0010-teach.rs | 5 | ||||
-rw-r--r-- | tests/ui/error-codes/E0010-teach.stderr | 21 | ||||
-rw-r--r-- | tests/ui/error-codes/E0010.rs | 5 | ||||
-rw-r--r-- | tests/ui/error-codes/E0010.stderr | 22 | ||||
-rw-r--r-- | tests/ui/error-codes/E0030-teach.rs | 1 | ||||
-rw-r--r-- | tests/ui/error-codes/E0030-teach.stderr | 8 | ||||
-rw-r--r-- | tests/ui/error-codes/E0030.rs | 1 | ||||
-rw-r--r-- | tests/ui/error-codes/E0030.stderr | 8 | ||||
-rw-r--r-- | tests/ui/error-codes/E0184.stderr | 2 | ||||
-rw-r--r-- | tests/ui/error-codes/E0206.rs | 2 | ||||
-rw-r--r-- | tests/ui/error-codes/E0206.stderr | 2 | ||||
-rw-r--r-- | tests/ui/error-codes/E0275.stderr | 2 | ||||
-rw-r--r-- | tests/ui/error-codes/E0277-3.stderr | 3 | ||||
-rw-r--r-- | tests/ui/error-codes/E0449.stderr | 16 |
15 files changed, 56 insertions, 44 deletions
diff --git a/tests/ui/error-codes/E0004.stderr b/tests/ui/error-codes/E0004.stderr index 4ac8c904f..603bc5237 100644 --- a/tests/ui/error-codes/E0004.stderr +++ b/tests/ui/error-codes/E0004.stderr @@ -14,7 +14,7 @@ LL | HastaLaVistaBaby, = note: the matched value is of type `Terminator` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | -LL ~ Terminator::TalkToMyHand => {} +LL ~ Terminator::TalkToMyHand => {}, LL + Terminator::HastaLaVistaBaby => todo!() | diff --git a/tests/ui/error-codes/E0010-teach.rs b/tests/ui/error-codes/E0010-teach.rs index fc5dffb37..798fcda2a 100644 --- a/tests/ui/error-codes/E0010-teach.rs +++ b/tests/ui/error-codes/E0010-teach.rs @@ -1,8 +1,7 @@ // compile-flags: -Z teach -#![feature(box_syntax)] #![allow(warnings)] -const CON : Box<i32> = box 0; //~ ERROR E0010 - +const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010 +//~| ERROR cannot call non-const fn fn main() {} diff --git a/tests/ui/error-codes/E0010-teach.stderr b/tests/ui/error-codes/E0010-teach.stderr index 33de9fd68..7634970f3 100644 --- a/tests/ui/error-codes/E0010-teach.stderr +++ b/tests/ui/error-codes/E0010-teach.stderr @@ -1,11 +1,22 @@ error[E0010]: allocations are not allowed in constants - --> $DIR/E0010-teach.rs:6:24 + --> $DIR/E0010-teach.rs:5:23 | -LL | const CON : Box<i32> = box 0; - | ^^^^^ allocation not allowed in constants +LL | const CON: Vec<i32> = vec![1, 2, 3]; + | ^^^^^^^^^^^^^ allocation not allowed in constants | = note: The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time. + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants + --> $DIR/E0010-teach.rs:5:23 + | +LL | const CON: Vec<i32> = vec![1, 2, 3]; + | ^^^^^^^^^^^^^ + | + = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0010`. +Some errors have detailed explanations: E0010, E0015. +For more information about an error, try `rustc --explain E0010`. diff --git a/tests/ui/error-codes/E0010.rs b/tests/ui/error-codes/E0010.rs index e62997640..11721efff 100644 --- a/tests/ui/error-codes/E0010.rs +++ b/tests/ui/error-codes/E0010.rs @@ -1,6 +1,5 @@ -#![feature(box_syntax)] #![allow(warnings)] -const CON : Box<i32> = box 0; //~ ERROR E0010 - +const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010 +//~| ERROR cannot call non-const fn fn main() {} diff --git a/tests/ui/error-codes/E0010.stderr b/tests/ui/error-codes/E0010.stderr index 0042333b9..089472224 100644 --- a/tests/ui/error-codes/E0010.stderr +++ b/tests/ui/error-codes/E0010.stderr @@ -1,9 +1,21 @@ error[E0010]: allocations are not allowed in constants - --> $DIR/E0010.rs:4:24 + --> $DIR/E0010.rs:3:23 | -LL | const CON : Box<i32> = box 0; - | ^^^^^ allocation not allowed in constants +LL | const CON: Vec<i32> = vec![1, 2, 3]; + | ^^^^^^^^^^^^^ allocation not allowed in constants + | + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants + --> $DIR/E0010.rs:3:23 + | +LL | const CON: Vec<i32> = vec![1, 2, 3]; + | ^^^^^^^^^^^^^ + | + = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0010`. +Some errors have detailed explanations: E0010, E0015. +For more information about an error, try `rustc --explain E0010`. diff --git a/tests/ui/error-codes/E0030-teach.rs b/tests/ui/error-codes/E0030-teach.rs index 8caa4f093..388064fb0 100644 --- a/tests/ui/error-codes/E0030-teach.rs +++ b/tests/ui/error-codes/E0030-teach.rs @@ -4,6 +4,5 @@ fn main() { match 5u32 { 1000 ..= 5 => {} //~^ ERROR lower range bound must be less than or equal to upper - //~| ERROR lower range bound must be less than or equal to upper } } diff --git a/tests/ui/error-codes/E0030-teach.stderr b/tests/ui/error-codes/E0030-teach.stderr index 800f66416..3f1ad4af3 100644 --- a/tests/ui/error-codes/E0030-teach.stderr +++ b/tests/ui/error-codes/E0030-teach.stderr @@ -6,12 +6,6 @@ LL | 1000 ..= 5 => {} | = note: When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range. -error[E0030]: lower range bound must be less than or equal to upper - --> $DIR/E0030-teach.rs:5:9 - | -LL | 1000 ..= 5 => {} - | ^^^^ lower bound larger than upper bound - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0030`. diff --git a/tests/ui/error-codes/E0030.rs b/tests/ui/error-codes/E0030.rs index a5d8f8726..58d856b7c 100644 --- a/tests/ui/error-codes/E0030.rs +++ b/tests/ui/error-codes/E0030.rs @@ -2,6 +2,5 @@ fn main() { match 5u32 { 1000 ..= 5 => {} //~^ ERROR lower range bound must be less than or equal to upper - //~| ERROR lower range bound must be less than or equal to upper } } diff --git a/tests/ui/error-codes/E0030.stderr b/tests/ui/error-codes/E0030.stderr index 8a6114024..db8161d8f 100644 --- a/tests/ui/error-codes/E0030.stderr +++ b/tests/ui/error-codes/E0030.stderr @@ -4,12 +4,6 @@ error[E0030]: lower range bound must be less than or equal to upper LL | 1000 ..= 5 => {} | ^^^^ lower bound larger than upper bound -error[E0030]: lower range bound must be less than or equal to upper - --> $DIR/E0030.rs:3:9 - | -LL | 1000 ..= 5 => {} - | ^^^^ lower bound larger than upper bound - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0030`. diff --git a/tests/ui/error-codes/E0184.stderr b/tests/ui/error-codes/E0184.stderr index bb3017b6e..52f1f30a4 100644 --- a/tests/ui/error-codes/E0184.stderr +++ b/tests/ui/error-codes/E0184.stderr @@ -1,4 +1,4 @@ -error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor +error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor --> $DIR/E0184.rs:1:10 | LL | #[derive(Copy)] diff --git a/tests/ui/error-codes/E0206.rs b/tests/ui/error-codes/E0206.rs index 0f3d427ce..74738d810 100644 --- a/tests/ui/error-codes/E0206.rs +++ b/tests/ui/error-codes/E0206.rs @@ -2,7 +2,7 @@ struct Bar; impl Copy for &'static mut Bar { } -//~^ ERROR the trait `Copy` may not be implemented for this type +//~^ ERROR the trait `Copy` cannot be implemented for this type fn main() { } diff --git a/tests/ui/error-codes/E0206.stderr b/tests/ui/error-codes/E0206.stderr index 57ae2647d..60d8d7bfe 100644 --- a/tests/ui/error-codes/E0206.stderr +++ b/tests/ui/error-codes/E0206.stderr @@ -1,4 +1,4 @@ -error[E0206]: the trait `Copy` may not be implemented for this type +error[E0206]: the trait `Copy` cannot be implemented for this type --> $DIR/E0206.rs:4:15 | LL | impl Copy for &'static mut Bar { } diff --git a/tests/ui/error-codes/E0275.stderr b/tests/ui/error-codes/E0275.stderr index cf9a7f69b..03c37d6f0 100644 --- a/tests/ui/error-codes/E0275.stderr +++ b/tests/ui/error-codes/E0275.stderr @@ -11,7 +11,7 @@ note: required for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar< LL | impl<T> Foo for T where Bar<T>: Foo {} | ^^^ ^ --- unsatisfied trait bound introduced here = note: the full type name has been written to '$TEST_BUILD_DIR/error-codes/E0275/E0275.long-type-hash.txt' - = note: 127 redundant requirements hidden + = note: 126 redundant requirements hidden = note: required for `Bar<T>` to implement `Foo` error: aborting due to previous error diff --git a/tests/ui/error-codes/E0277-3.stderr b/tests/ui/error-codes/E0277-3.stderr index 0127e1ccc..0d4782935 100644 --- a/tests/ui/error-codes/E0277-3.stderr +++ b/tests/ui/error-codes/E0277-3.stderr @@ -14,7 +14,8 @@ LL | fn foo<T: PartialEq>(_: T) {} | ^^^^^^^^^ required by this bound in `foo` help: consider annotating `S` with `#[derive(PartialEq)]` | -LL | #[derive(PartialEq)] +LL + #[derive(PartialEq)] +LL | struct S; | error: aborting due to previous error diff --git a/tests/ui/error-codes/E0449.stderr b/tests/ui/error-codes/E0449.stderr index 8221a5e0a..cf41bcce8 100644 --- a/tests/ui/error-codes/E0449.stderr +++ b/tests/ui/error-codes/E0449.stderr @@ -1,22 +1,26 @@ -error[E0449]: unnecessary visibility qualifier +error[E0449]: visibility qualifiers are not permitted here --> $DIR/E0449.rs:7:1 | LL | pub impl Bar {} - | ^^^ `pub` not permitted here because it's implied + | ^^^ | = note: place qualifiers on individual impl items instead -error[E0449]: unnecessary visibility qualifier +error[E0449]: visibility qualifiers are not permitted here --> $DIR/E0449.rs:9:1 | LL | pub impl Foo for Bar { - | ^^^ `pub` not permitted here because it's implied + | ^^^ + | + = note: trait items always share the visibility of their trait -error[E0449]: unnecessary visibility qualifier +error[E0449]: visibility qualifiers are not permitted here --> $DIR/E0449.rs:10:5 | LL | pub fn foo() {} - | ^^^ `pub` not permitted here because it's implied + | ^^^ + | + = note: trait items always share the visibility of their trait error: aborting due to 3 previous errors |