Skip to content

Commit

Permalink
Reblessed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Regueiro committed Jun 5, 2019
1 parent c105c28 commit 10b6daa
Show file tree
Hide file tree
Showing 46 changed files with 255 additions and 676 deletions.
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/libtest-json/output.json
Expand Up @@ -2,7 +2,7 @@
{ "type": "test", "event": "started", "name": "a" }
{ "type": "test", "name": "a", "event": "ok" }
{ "type": "test", "event": "started", "name": "b" }
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:8:5\nnote: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" }
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:8:5\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" }
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok" }
{ "type": "test", "event": "started", "name": "d" }
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/multi-panic.rs
Expand Up @@ -8,7 +8,7 @@ fn check_for_no_backtrace(test: std::process::Output) {
let mut it = err.lines();

assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked at")), Some(true));
assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` \
assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \
environment variable to display a backtrace."));
assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
assert_eq!(it.next(), None);
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/failed-doctest-output.stdout
Expand Up @@ -27,7 +27,7 @@ stderr:
stderr 1
stderr 2
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:7:1
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.



Expand Down
7 changes: 6 additions & 1 deletion src/test/ui/associated-type-bounds/duplicate.stderr
@@ -1,3 +1,9 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/duplicate.rs:7:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:12:36
|
Expand Down Expand Up @@ -624,4 +630,3 @@ error: could not find defining uses

error: aborting due to 93 previous errors

For more information about this error, try `rustc --explain E0719`.
6 changes: 6 additions & 0 deletions src/test/ui/associated-type-bounds/dyn-lcsit.stderr
@@ -0,0 +1,6 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/dyn-lcsit.rs:4:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

Expand Up @@ -2,9 +2,7 @@ error[E0623]: lifetime mismatch
--> $DIR/implied-region-constraints.rs:19:64
|
LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
| -------------
| |
| this type is declared with multiple lifetimes...
| ------------- this type is declared with multiple lifetimes...
...
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
| ^^^^^ ...but data with one lifetime flows into the other here
Expand All @@ -13,13 +11,10 @@ error[E0623]: lifetime mismatch
--> $DIR/implied-region-constraints.rs:40:72
|
LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
| --------------
| |
| this type is declared with multiple lifetimes...
| -------------- this type is declared with multiple lifetimes...
...
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
| ^^ ...but data with one lifetime flows into the other here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0623`.
6 changes: 6 additions & 0 deletions src/test/ui/associated-type-bounds/lcsit.stderr
@@ -0,0 +1,6 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/lcsit.rs:4:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

Expand Up @@ -49,7 +49,7 @@ error[E0308]: mismatched types
|
LL | let _: i32 = f2(2i32);
| ^^^^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
104 changes: 13 additions & 91 deletions src/test/ui/borrowck/borrowck-closures-two-mut.stderr
@@ -1,80 +1,5 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:14:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| x = 5);
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:26:24
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:34:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:55:24
|
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
--> $DIR/borrowck-closures-two-mut.rs:14:24
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:12:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - first borrow occurs due to use of `x` in closure
Expand All @@ -84,12 +9,11 @@ LL | let c2 = to_fn_mut(|| x = 5);
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL |
LL | drop((c1, c2));
| -- first borrow later used here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
--> $DIR/borrowck-closures-two-mut.rs:26:24
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:23:24
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - first borrow occurs due to use of `x` in closure
Expand All @@ -99,12 +23,11 @@ LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL |
LL | drop((c1, c2));
| -- first borrow later used here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
--> $DIR/borrowck-closures-two-mut.rs:34:24
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:30:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
Expand All @@ -114,12 +37,11 @@ LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL |
LL | drop((c1, c2));
| -- first borrow later used here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
--> $DIR/borrowck-closures-two-mut.rs:42:24
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:37:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
Expand All @@ -129,12 +51,12 @@ LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nes
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL |
LL | drop((c1, c2));
| -- first borrow later used here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
--> $DIR/borrowck-closures-two-mut.rs:55:24
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- - first borrow occurs due to use of `x` in closure
Expand All @@ -144,10 +66,10 @@ LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL |
LL | drop((c1, c2));
| -- first borrow later used here

error: aborting due to 10 previous errors
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0499`.
16 changes: 3 additions & 13 deletions src/test/ui/borrowck/borrowck-reinit.stderr
@@ -1,15 +1,5 @@
error[E0382]: use of moved value: `x` (Ast)
--> $DIR/borrowck-reinit.rs:8:16
|
LL | drop(x);
| - value moved here
LL | let _ = (1,x);
| ^ value used here after move
|
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `x` (Mir)
--> $DIR/borrowck-reinit.rs:8:16
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-reinit.rs:6:16
|
LL | let mut x = Box::new(0);
| ----- move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
Expand All @@ -19,6 +9,6 @@ LL | drop(x);
LL | let _ = (1,x);
| ^ value used here after move

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0382`.
12 changes: 3 additions & 9 deletions src/test/ui/borrowck/borrowck-storage-dead.stderr
@@ -1,15 +1,9 @@
error[E0381]: use of possibly uninitialized variable: `x` (Ast)
--> $DIR/borrowck-storage-dead.rs:18:17
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/borrowck-storage-dead.rs:16:17
|
LL | let _ = x + 1;
| ^ use of possibly uninitialized `x`

error[E0381]: use of possibly uninitialized variable: `x` (Mir)
--> $DIR/borrowck-storage-dead.rs:18:17
|
LL | let _ = x + 1;
| ^ use of possibly uninitialized `x`

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0381`.
14 changes: 3 additions & 11 deletions src/test/ui/borrowck/immutable-arg.stderr
@@ -1,19 +1,11 @@
error[E0384]: cannot assign twice to immutable variable `_x` (Ast)
--> $DIR/immutable-arg.rs:4:5
|
LL | fn foo(_x: u32) {
| -- first assignment to `_x`
LL | _x = 4;
| ^^^^^^ cannot assign twice to immutable variable

error[E0384]: cannot assign to immutable argument `_x` (Mir)
--> $DIR/immutable-arg.rs:4:5
error[E0384]: cannot assign to immutable argument `_x`
--> $DIR/immutable-arg.rs:2:5
|
LL | fn foo(_x: u32) {
| -- help: make this binding mutable: `mut _x`
LL | _x = 4;
| ^^^^^^ cannot assign to immutable argument

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0384`.
24 changes: 3 additions & 21 deletions src/test/ui/borrowck/issue-41962.stderr
@@ -1,29 +1,11 @@
error[E0382]: use of partially moved value: `maybe` (Ast)
--> $DIR/issue-41962.rs:7:30
|
LL | if let Some(thing) = maybe {
| ----- ^^^^^ value used here after move
| |
| value moved here
|
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast)
--> $DIR/issue-41962.rs:7:21
|
LL | if let Some(thing) = maybe {
| ^^^^^ value moved here in previous iteration of loop
|
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value (Mir)
--> $DIR/issue-41962.rs:7:21
error[E0382]: use of moved value
--> $DIR/issue-41962.rs:5:21
|
LL | if let Some(thing) = maybe {
| ^^^^^ value moved here, in previous iteration of loop
|
= note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error: aborting due to 3 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0382`.
Expand Up @@ -4,17 +4,17 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^

error: type parameters must be declared prior to const parameters
error: lifetime parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:4:21
|
LL | fn foo<const X: (), T>(_: &T) {
| --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>`
LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>`

error: lifetime parameters must be declared prior to const parameters
error: type parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:8:21
|
LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>`
LL | fn foo<const X: (), T>(_: &T) {
| --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion src/test/ui/deprecation/deprecation-in-staged-api.stderr
@@ -1,4 +1,4 @@
error: `#[deprecated]` cannot be used in staged api, use `#[rustc_deprecated]` instead
error: `#[deprecated]` cannot be used in staged API; use `#[rustc_deprecated]` instead
--> $DIR/deprecation-in-staged-api.rs:8:1
|
LL | fn main() { }
Expand Down

0 comments on commit 10b6daa

Please sign in to comment.