Skip to content

Commit

Permalink
Auto merge of #59250 - bovinebuddha:filter_ui_revision_tests, r=petro…
Browse files Browse the repository at this point in the history
…chenkov

Filter ui revision tests

Updates UI test output filtering to also filter away test annotations for revisions:

Previously filtered: //~ ERROR [XXXX]
Now also filters: //[revision]~ ERROR [XXXX]

I reckon, if we have the one, we should have the other for consistency, its lack was probably an oversight (the existence of revision testing is not really well documented...)
  • Loading branch information
bors committed Mar 17, 2019
2 parents c82834e + 704649d commit 817d074
Show file tree
Hide file tree
Showing 175 changed files with 561 additions and 721 deletions.
4 changes: 2 additions & 2 deletions src/test/ui/E0501.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
LL | outside_closure_1(a);
| ^ second borrow occurs here
...
LL | drop(bar);
Expand All @@ -20,7 +20,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
LL | outside_closure_2(a);
| ^ second borrow occurs here
...
LL | drop(bar);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/E0501.ast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
LL | outside_closure_1(a);
| ^ borrow occurs here
...
LL | }
Expand All @@ -20,7 +20,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
LL | outside_closure_2(a);
| ^ borrow occurs here
...
LL | }
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/E0501.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
LL | outside_closure_1(a);
| ^ second borrow occurs here
...
LL | drop(bar);
Expand All @@ -20,7 +20,7 @@ LL | let bar = || {
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
LL | outside_closure_2(a);
| ^ second borrow occurs here
...
LL | drop(bar);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0506.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
LL | fancy_num = FancyNum { num: 6 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0506.ast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
LL | let fancy_ref = &fancy_num;
| --------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
LL | fancy_num = FancyNum { num: 6 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0506.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
LL | fancy_num = FancyNum { num: 6 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0508-fail.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508-fail.rs:8:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
LL | let _value = array[0];
| ^^^^^^^^
| |
| cannot move out of here
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0508-fail.ast.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508-fail.rs:8:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
LL | let _value = array[0];
| ^^^^^^^^
| |
| cannot move out of here
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0508-fail.mir.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508-fail.rs:8:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
LL | let _value = array[0];
| ^^^^^^^^
| |
| cannot move out of here
Expand Down
12 changes: 0 additions & 12 deletions src/test/ui/E0508.ast.stderr

This file was deleted.

12 changes: 0 additions & 12 deletions src/test/ui/E0508.mir.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/ui/E0594.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:7:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
LL | NUM = 20;
| ^^^^^^^^ cannot assign

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0594.ast.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0594]: cannot assign to immutable static item
--> $DIR/E0594.rs:7:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
LL | NUM = 20;
| ^^^^^^^^

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0594.mir.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:7:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
LL | NUM = 20;
| ^^^^^^^^ cannot assign

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0596.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
LL | let y = &mut x;
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0596.ast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable
|
LL | let x = 1;
| - help: make this binding mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
LL | let y = &mut x;
| ^ cannot borrow mutably

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/E0596.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
LL | let y = &mut x;
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/assign-imm-local-twice.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
LL | let v: isize;
| - help: make this binding mutable: `mut v`
...
LL | v = 1; //[ast]~ NOTE first assignment
LL | v = 1;
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
LL | v = 2;
| ^^^^^ cannot assign twice to immutable variable

error: aborting due to previous error
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/assign-imm-local-twice.ast.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0384]: cannot assign twice to immutable variable `v`
--> $DIR/assign-imm-local-twice.rs:11:5
|
LL | v = 1; //[ast]~ NOTE first assignment
LL | v = 1;
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
LL | v = 2;
| ^^^^^ cannot assign twice to immutable variable

error: aborting due to previous error
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/assign-imm-local-twice.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
LL | let v: isize;
| - help: make this binding mutable: `mut v`
...
LL | v = 1; //[ast]~ NOTE first assignment
LL | v = 1;
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
LL | v = 2;
| ^^^^^ cannot assign twice to immutable variable

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: compilation successful
--> $DIR/bound-lifetime-in-binding-only.rs:71:1
|
LL | fn main() { } //[ok]~ ERROR compilation successful
LL | fn main() { }
| ^^^^^^^^^^^^^

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: compilation successful
--> $DIR/bound-lifetime-in-return-only.rs:49:1
|
LL | fn main() { } //[ok]~ ERROR compilation successful
LL | fn main() { }
| ^^^^^^^^^^^^^

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
| |
| this parameter and the return type are declared with different lifetimes...
...
LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
LL | (a, b)
| ^ ...but data from `y` is returned here

error[E0623]: lifetime mismatch
Expand All @@ -17,7 +17,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
| |
| this parameter and the return type are declared with different lifetimes...
...
LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
LL | (a, b)
| ^ ...but data from `x` is returned here

error: aborting due to 2 previous errors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/project-fn-ret-contravariant.rs:38:8
|
LL | bar(foo, x) //[transmute]~ ERROR E0495
LL | bar(foo, x)
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8...
Expand All @@ -12,13 +12,13 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
note: ...so that reference does not outlive borrowed content
--> $DIR/project-fn-ret-contravariant.rs:38:13
|
LL | bar(foo, x) //[transmute]~ ERROR E0495
LL | bar(foo, x)
| ^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that reference does not outlive borrowed content
--> $DIR/project-fn-ret-contravariant.rs:38:4
|
LL | bar(foo, x) //[transmute]~ ERROR E0495
LL | bar(foo, x)
| ^^^^^^^^^^^

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -------- --------------------
| |
| this parameter and the return type are declared with different lifetimes...
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
LL | let a = bar(foo, y);
| ^ ...but data from `x` is returned here

error[E0623]: lifetime mismatch
Expand All @@ -15,8 +15,8 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -------- --------------------
| |
| this parameter and the return type are declared with different lifetimes...
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
LL | let b = bar(foo, x); //[krisskross]~ ERROR E0623
LL | let a = bar(foo, y);
LL | let b = bar(foo, x);
| ^ ...but data from `y` is returned here

error: aborting due to 2 previous errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| |
| this parameter and the return type are declared with different lifetimes...
...
LL | let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623]
LL | let b = bar(f, y);
| ^ ...but data from `x` is returned here

error: aborting due to previous error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/project-fn-ret-invariant.rs:48:8
|
LL | bar(foo, x) //[transmute]~ ERROR E0495
LL | bar(foo, x)
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error: compilation successful
--> $DIR/higher-ranked-projection.rs:24:1
|
LL | / fn main() { //[good]~ ERROR compilation successful
LL | / fn main() {
LL | | foo(());
LL | | //[bad]~^ ERROR type mismatch
LL | |
LL | | }
| |_^

Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
...
LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
LL | let _y1 = &mut x;
| ^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow immutable static item `static_x` as mutable
--> $DIR/borrowck-access-permissions.rs:18:19
|
LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
LL | let _y1 = &mut static_x;
| ^^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
Expand All @@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m
LL | let box_x = Box::new(1);
| ----- help: consider changing this to be mutable: `mut box_x`
...
LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
LL | let _y1 = &mut *box_x;
| ^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
Expand All @@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
LL | let ref_x = &x;
| -- help: consider changing this to be a mutable reference: `&mut x`
...
LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
LL | let _y1 = &mut *ref_x;
| ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable

error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
Expand All @@ -37,15 +37,15 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin
LL | let ptr_x : *const _ = &x;
| -- help: consider changing this to be a mutable pointer: `&mut x`
...
LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
LL | let _y1 = &mut *ptr_x;
| ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable

error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-access-permissions.rs:56:18
|
LL | let foo_ref = &foo;
| ---- help: consider changing this to be a mutable reference: `&mut foo`
LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
LL | let _y = &mut *foo_ref.f;
| ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable

error: aborting due to 6 previous errors
Expand Down
Loading

0 comments on commit 817d074

Please sign in to comment.