Skip to content

Commit 817d074

Browse files
committed
Auto merge of #59250 - bovinebuddha:filter_ui_revision_tests, r=petrochenkov
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...)
2 parents c82834e + 704649d commit 817d074

File tree

175 files changed

+561
-721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+561
-721
lines changed

src/test/ui/E0501.ast.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let bar = || {
66
LL | inside_closure(a)
77
| - first borrow occurs due to use of `a` in closure
88
LL | };
9-
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
9+
LL | outside_closure_1(a);
1010
| ^ second borrow occurs here
1111
...
1212
LL | drop(bar);
@@ -20,7 +20,7 @@ LL | let bar = || {
2020
LL | inside_closure(a)
2121
| - first borrow occurs due to use of `a` in closure
2222
...
23-
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
23+
LL | outside_closure_2(a);
2424
| ^ second borrow occurs here
2525
...
2626
LL | drop(bar);

src/test/ui/E0501.ast.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let bar = || {
66
LL | inside_closure(a)
77
| - previous borrow occurs due to use of `a` in closure
88
LL | };
9-
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
9+
LL | outside_closure_1(a);
1010
| ^ borrow occurs here
1111
...
1212
LL | }
@@ -20,7 +20,7 @@ LL | let bar = || {
2020
LL | inside_closure(a)
2121
| - previous borrow occurs due to use of `a` in closure
2222
...
23-
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
23+
LL | outside_closure_2(a);
2424
| ^ borrow occurs here
2525
...
2626
LL | }

src/test/ui/E0501.mir.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let bar = || {
66
LL | inside_closure(a)
77
| - first borrow occurs due to use of `a` in closure
88
LL | };
9-
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
9+
LL | outside_closure_1(a);
1010
| ^ second borrow occurs here
1111
...
1212
LL | drop(bar);
@@ -20,7 +20,7 @@ LL | let bar = || {
2020
LL | inside_closure(a)
2121
| - first borrow occurs due to use of `a` in closure
2222
...
23-
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
23+
LL | outside_closure_2(a);
2424
| ^ second borrow occurs here
2525
...
2626
LL | drop(bar);

src/test/ui/E0506.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
33
|
44
LL | let fancy_ref = &fancy_num;
55
| ---------- borrow of `fancy_num` occurs here
6-
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
6+
LL | fancy_num = FancyNum { num: 6 };
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
88
...
99
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);

src/test/ui/E0506.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
33
|
44
LL | let fancy_ref = &fancy_num;
55
| --------- borrow of `fancy_num` occurs here
6-
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
6+
LL | fancy_num = FancyNum { num: 6 };
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
88

99
error: aborting due to previous error

src/test/ui/E0506.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
33
|
44
LL | let fancy_ref = &fancy_num;
55
| ---------- borrow of `fancy_num` occurs here
6-
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
6+
LL | fancy_num = FancyNum { num: 6 };
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
88
...
99
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);

src/test/ui/E0508-fail.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
22
--> $DIR/E0508-fail.rs:8:18
33
|
4-
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
4+
LL | let _value = array[0];
55
| ^^^^^^^^
66
| |
77
| cannot move out of here

src/test/ui/E0508-fail.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
22
--> $DIR/E0508-fail.rs:8:18
33
|
4-
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
4+
LL | let _value = array[0];
55
| ^^^^^^^^
66
| |
77
| cannot move out of here

src/test/ui/E0508-fail.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
22
--> $DIR/E0508-fail.rs:8:18
33
|
4-
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
4+
LL | let _value = array[0];
55
| ^^^^^^^^
66
| |
77
| cannot move out of here

src/test/ui/E0508.ast.stderr

-12
This file was deleted.

src/test/ui/E0508.mir.stderr

-12
This file was deleted.

src/test/ui/E0594.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0594]: cannot assign to immutable static item `NUM`
22
--> $DIR/E0594.rs:7:5
33
|
4-
LL | NUM = 20; //[ast]~ ERROR E0594
4+
LL | NUM = 20;
55
| ^^^^^^^^ cannot assign
66

77
error: aborting due to previous error

src/test/ui/E0594.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0594]: cannot assign to immutable static item
22
--> $DIR/E0594.rs:7:5
33
|
4-
LL | NUM = 20; //[ast]~ ERROR E0594
4+
LL | NUM = 20;
55
| ^^^^^^^^
66

77
error: aborting due to previous error

src/test/ui/E0594.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0594]: cannot assign to immutable static item `NUM`
22
--> $DIR/E0594.rs:7:5
33
|
4-
LL | NUM = 20; //[ast]~ ERROR E0594
4+
LL | NUM = 20;
55
| ^^^^^^^^ cannot assign
66

77
error: aborting due to previous error

src/test/ui/E0596.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
33
|
44
LL | let x = 1;
55
| - help: consider changing this to be mutable: `mut x`
6-
LL | let y = &mut x; //[ast]~ ERROR [E0596]
6+
LL | let y = &mut x;
77
| ^^^^^^ cannot borrow as mutable
88

99
error: aborting due to previous error

src/test/ui/E0596.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable
33
|
44
LL | let x = 1;
55
| - help: make this binding mutable: `mut x`
6-
LL | let y = &mut x; //[ast]~ ERROR [E0596]
6+
LL | let y = &mut x;
77
| ^ cannot borrow mutably
88

99
error: aborting due to previous error

src/test/ui/E0596.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
33
|
44
LL | let x = 1;
55
| - help: consider changing this to be mutable: `mut x`
6-
LL | let y = &mut x; //[ast]~ ERROR [E0596]
6+
LL | let y = &mut x;
77
| ^^^^^^ cannot borrow as mutable
88

99
error: aborting due to previous error

src/test/ui/assign-imm-local-twice.ast.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
44
LL | let v: isize;
55
| - help: make this binding mutable: `mut v`
66
...
7-
LL | v = 1; //[ast]~ NOTE first assignment
7+
LL | v = 1;
88
| ----- first assignment to `v`
99
...
10-
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
10+
LL | v = 2;
1111
| ^^^^^ cannot assign twice to immutable variable
1212

1313
error: aborting due to previous error

src/test/ui/assign-imm-local-twice.ast.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0384]: cannot assign twice to immutable variable `v`
22
--> $DIR/assign-imm-local-twice.rs:11:5
33
|
4-
LL | v = 1; //[ast]~ NOTE first assignment
4+
LL | v = 1;
55
| ----- first assignment to `v`
66
...
7-
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
7+
LL | v = 2;
88
| ^^^^^ cannot assign twice to immutable variable
99

1010
error: aborting due to previous error

src/test/ui/assign-imm-local-twice.mir.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
44
LL | let v: isize;
55
| - help: make this binding mutable: `mut v`
66
...
7-
LL | v = 1; //[ast]~ NOTE first assignment
7+
LL | v = 1;
88
| ----- first assignment to `v`
99
...
10-
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
10+
LL | v = 2;
1111
| ^^^^^ cannot assign twice to immutable variable
1212

1313
error: aborting due to previous error

src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: compilation successful
22
--> $DIR/bound-lifetime-in-binding-only.rs:71:1
33
|
4-
LL | fn main() { } //[ok]~ ERROR compilation successful
4+
LL | fn main() { }
55
| ^^^^^^^^^^^^^
66

77
error: aborting due to previous error

src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: compilation successful
22
--> $DIR/bound-lifetime-in-return-only.rs:49:1
33
|
4-
LL | fn main() { } //[ok]~ ERROR compilation successful
4+
LL | fn main() { }
55
| ^^^^^^^^^^^^^
66

77
error: aborting due to previous error

src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
66
| |
77
| this parameter and the return type are declared with different lifetimes...
88
...
9-
LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
9+
LL | (a, b)
1010
| ^ ...but data from `y` is returned here
1111

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

2323
error: aborting due to 2 previous errors

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
22
--> $DIR/project-fn-ret-contravariant.rs:38:8
33
|
4-
LL | bar(foo, x) //[transmute]~ ERROR E0495
4+
LL | bar(foo, x)
55
| ^^^
66
|
77
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8...
@@ -12,13 +12,13 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
1212
note: ...so that reference does not outlive borrowed content
1313
--> $DIR/project-fn-ret-contravariant.rs:38:13
1414
|
15-
LL | bar(foo, x) //[transmute]~ ERROR E0495
15+
LL | bar(foo, x)
1616
| ^
1717
= note: but, the lifetime must be valid for the static lifetime...
1818
note: ...so that reference does not outlive borrowed content
1919
--> $DIR/project-fn-ret-contravariant.rs:38:4
2020
|
21-
LL | bar(foo, x) //[transmute]~ ERROR E0495
21+
LL | bar(foo, x)
2222
| ^^^^^^^^^^^
2323

2424
error: aborting due to previous error

src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
55
| -------- --------------------
66
| |
77
| this parameter and the return type are declared with different lifetimes...
8-
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
8+
LL | let a = bar(foo, y);
99
| ^ ...but data from `x` is returned here
1010

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

2222
error: aborting due to 2 previous errors

src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
66
| |
77
| this parameter and the return type are declared with different lifetimes...
88
...
9-
LL | let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623]
9+
LL | let b = bar(f, y);
1010
| ^ ...but data from `x` is returned here
1111

1212
error: aborting due to previous error

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
22
--> $DIR/project-fn-ret-invariant.rs:48:8
33
|
4-
LL | bar(foo, x) //[transmute]~ ERROR E0495
4+
LL | bar(foo, x)
55
| ^^^
66
|
77
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8...

src/test/ui/associated-types/higher-ranked-projection.good.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
error: compilation successful
22
--> $DIR/higher-ranked-projection.rs:24:1
33
|
4-
LL | / fn main() { //[good]~ ERROR compilation successful
4+
LL | / fn main() {
55
LL | | foo(());
6-
LL | | //[bad]~^ ERROR type mismatch
6+
LL | |
77
LL | | }
88
| |_^
99

src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
44
LL | let x = 1;
55
| - help: consider changing this to be mutable: `mut x`
66
...
7-
LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
7+
LL | let _y1 = &mut x;
88
| ^^^^^^ cannot borrow as mutable
99

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

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

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

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

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

5151
error: aborting due to 6 previous errors

0 commit comments

Comments
 (0)