Skip to content

Commit 61efc3b

Browse files
committed
Update tests
1 parent 2664aad commit 61efc3b

File tree

154 files changed

+387
-252
lines changed

Some content is hidden

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

154 files changed

+387
-252
lines changed

src/test/ui/associated-types/associated-types-overridden-binding-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ trait I32Iterator = Iterator<Item = i32>;
1414

1515
fn main() {
1616
let _: &I32Iterator<Item = u32> = &vec![42].into_iter();
17+
//~^ ERROR type mismatch
1718
}

src/test/ui/associated-types/associated-types-overridden-binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(trait_alias)]
1212

1313
trait Foo: Iterator<Item = i32> {}
14-
trait Bar: Foo<Item = u32> {}
14+
trait Bar: Foo<Item = u32> {} //~ ERROR type annotations required
1515

1616
trait I32Iterator = Iterator<Item = i32>;
1717
trait U32Iterator = I32Iterator<Item = u32>;

src/test/ui/associated-types/associated-types-overridden-binding.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0284]: type annotations required: cannot resolve `<Self as std::iter::Iterator>::Item == i32`
22
--> $DIR/associated-types-overridden-binding.rs:14:1
33
|
4-
LL | trait Bar: Foo<Item = u32> {}
4+
LL | trait Bar: Foo<Item = u32> {} //~ ERROR type annotations required
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: required by `Foo`

src/test/ui/await-keyword/2015-edition-warning.fixed

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55

66
mod outer_mod {
77
pub mod r#await {
8+
//~^ ERROR `await` is a keyword
9+
//~| WARN was previously accepted
810
pub struct r#await;
11+
//~^ ERROR `await` is a keyword
12+
//~| WARN was previously accepted
913
}
1014
}
1115
use outer_mod::r#await::r#await;
16+
//~^ ERROR `await` is a keyword
17+
//~| ERROR `await` is a keyword
18+
//~| WARN was previously accepted
19+
//~| WARN was previously accepted
1220

1321
fn main() {
1422
match r#await { r#await => {} }
23+
//~^ ERROR `await` is a keyword
24+
//~| ERROR `await` is a keyword
25+
//~| WARN was previously accepted
26+
//~| WARN was previously accepted
1527
}

src/test/ui/await-keyword/2015-edition-warning.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55

66
mod outer_mod {
77
pub mod await {
8+
//~^ ERROR `await` is a keyword
9+
//~| WARN was previously accepted
810
pub struct await;
11+
//~^ ERROR `await` is a keyword
12+
//~| WARN was previously accepted
913
}
1014
}
1115
use outer_mod::await::await;
16+
//~^ ERROR `await` is a keyword
17+
//~| ERROR `await` is a keyword
18+
//~| WARN was previously accepted
19+
//~| WARN was previously accepted
1220

1321
fn main() {
1422
match await { await => {} }
23+
//~^ ERROR `await` is a keyword
24+
//~| ERROR `await` is a keyword
25+
//~| WARN was previously accepted
26+
//~| WARN was previously accepted
1527
}

src/test/ui/await-keyword/2015-edition-warning.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | #![deny(keyword_idents)]
1313
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1414

1515
error: `await` is a keyword in the 2018 edition
16-
--> $DIR/2015-edition-warning.rs:8:20
16+
--> $DIR/2015-edition-warning.rs:10:20
1717
|
1818
LL | pub struct await;
1919
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
@@ -22,7 +22,7 @@ LL | pub struct await;
2222
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
2323

2424
error: `await` is a keyword in the 2018 edition
25-
--> $DIR/2015-edition-warning.rs:11:16
25+
--> $DIR/2015-edition-warning.rs:15:16
2626
|
2727
LL | use outer_mod::await::await;
2828
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
@@ -31,7 +31,7 @@ LL | use outer_mod::await::await;
3131
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3232

3333
error: `await` is a keyword in the 2018 edition
34-
--> $DIR/2015-edition-warning.rs:11:23
34+
--> $DIR/2015-edition-warning.rs:15:23
3535
|
3636
LL | use outer_mod::await::await;
3737
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
@@ -40,7 +40,7 @@ LL | use outer_mod::await::await;
4040
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4141

4242
error: `await` is a keyword in the 2018 edition
43-
--> $DIR/2015-edition-warning.rs:14:11
43+
--> $DIR/2015-edition-warning.rs:22:11
4444
|
4545
LL | match await { await => {} }
4646
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
@@ -49,7 +49,7 @@ LL | match await { await => {} }
4949
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5050

5151
error: `await` is a keyword in the 2018 edition
52-
--> $DIR/2015-edition-warning.rs:14:19
52+
--> $DIR/2015-edition-warning.rs:22:19
5353
|
5454
LL | match await { await => {} }
5555
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`

src/test/ui/await-keyword/2018-edition-error.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#![allow(non_camel_case_types)]
33

44
mod outer_mod {
5-
pub mod await {
6-
pub struct await;
5+
pub mod await { //~ ERROR `await` is a keyword
6+
pub struct await; //~ ERROR `await` is a keyword
77
}
88
}
9-
use self::outer_mod::await::await;
9+
use self::outer_mod::await::await; //~ ERROR `await` is a keyword
10+
//~^ ERROR `await` is a keyword
1011

1112
fn main() {
12-
match await { await => () }
13+
match await { await => () } //~ ERROR `await` is a keyword
14+
//~^ ERROR `await` is a keyword
1315
}

src/test/ui/await-keyword/2018-edition-error.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error[E0721]: `await` is a keyword in the 2018 edition
22
--> $DIR/2018-edition-error.rs:5:13
33
|
4-
LL | pub mod await {
4+
LL | pub mod await { //~ ERROR `await` is a keyword
55
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
66

77
error[E0721]: `await` is a keyword in the 2018 edition
88
--> $DIR/2018-edition-error.rs:6:20
99
|
10-
LL | pub struct await;
10+
LL | pub struct await; //~ ERROR `await` is a keyword
1111
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
1212

1313
error[E0721]: `await` is a keyword in the 2018 edition
1414
--> $DIR/2018-edition-error.rs:9:22
1515
|
16-
LL | use self::outer_mod::await::await;
16+
LL | use self::outer_mod::await::await; //~ ERROR `await` is a keyword
1717
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
1818

1919
error[E0721]: `await` is a keyword in the 2018 edition
2020
--> $DIR/2018-edition-error.rs:9:29
2121
|
22-
LL | use self::outer_mod::await::await;
22+
LL | use self::outer_mod::await::await; //~ ERROR `await` is a keyword
2323
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
2424

2525
error[E0721]: `await` is a keyword in the 2018 edition
26-
--> $DIR/2018-edition-error.rs:12:11
26+
--> $DIR/2018-edition-error.rs:13:11
2727
|
28-
LL | match await { await => () }
28+
LL | match await { await => () } //~ ERROR `await` is a keyword
2929
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
3030

3131
error[E0721]: `await` is a keyword in the 2018 edition
32-
--> $DIR/2018-edition-error.rs:12:19
32+
--> $DIR/2018-edition-error.rs:13:19
3333
|
34-
LL | match await { await => () }
34+
LL | match await { await => () } //~ ERROR `await` is a keyword
3535
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
3636

3737
error: aborting due to 6 previous errors

src/test/ui/await-keyword/post_expansion_error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ macro_rules! r#await {
66

77
fn main() {
88
await!()
9+
//~^ ERROR `await` is a keyword
910
}

src/test/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.ast.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `t.0`
2-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:25:31
2+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:26:31
33
|
44
LL | drop(t);
55
| - value moved here
@@ -10,7 +10,7 @@ LL | println!("{:?} {:?}", t.0, t.1);
1010
= note: move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
1111

1212
error[E0382]: use of moved value: `t.1`
13-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:25:36
13+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:26:36
1414
|
1515
LL | drop(t);
1616
| - value moved here
@@ -21,7 +21,7 @@ LL | println!("{:?} {:?}", t.0, t.1);
2121
= note: move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
2222

2323
error[E0382]: use of moved value: `u.0`
24-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:33:31
24+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:37:31
2525
|
2626
LL | drop(u);
2727
| - value moved here
@@ -32,7 +32,7 @@ LL | println!("{:?} {:?}", u.0, u.1);
3232
= note: move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
3333

3434
error[E0382]: use of moved value: `u.1`
35-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:33:36
35+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:37:36
3636
|
3737
LL | drop(u);
3838
| - value moved here
@@ -43,7 +43,7 @@ LL | println!("{:?} {:?}", u.0, u.1);
4343
= note: move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
4444

4545
error[E0382]: use of moved value: `v.x`
46-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:41:31
46+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:48:31
4747
|
4848
LL | drop(v);
4949
| - value moved here
@@ -54,7 +54,7 @@ LL | println!("{:?} {:?}", v.x, v.y);
5454
= note: move occurs because `v` has type `Spair`, which does not implement the `Copy` trait
5555

5656
error[E0382]: use of moved value: `v.y`
57-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:41:36
57+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:48:36
5858
|
5959
LL | drop(v);
6060
| - value moved here

src/test/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | t.0 = S(1);
99
= note: move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
1010

1111
error[E0382]: assign to part of moved value: `u`
12-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:31:9
12+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:34:9
1313
|
1414
LL | drop(u);
1515
| - value moved here
@@ -19,7 +19,7 @@ LL | u.0 = S(1);
1919
= note: move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
2020

2121
error[E0382]: assign to part of moved value: `v`
22-
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:39:9
22+
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:45:9
2323
|
2424
LL | drop(v);
2525
| - value moved here

src/test/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,32 @@ fn main() {
2121
let mut t: Tuple = (S(0), 0);
2222
drop(t);
2323
t.0 = S(1);
24+
//[nll]~^ ERROR assign to part of moved value
2425
t.1 = 2;
2526
println!("{:?} {:?}", t.0, t.1);
27+
//[ast]~^ ERROR use of moved value
28+
//[ast]~^^ ERROR use of moved value
2629
}
2730

2831
{
2932
let mut u: Tpair = Tpair(S(0), 0);
3033
drop(u);
3134
u.0 = S(1);
35+
//[nll]~^ ERROR assign to part of moved value
3236
u.1 = 2;
3337
println!("{:?} {:?}", u.0, u.1);
38+
//[ast]~^ ERROR use of moved value
39+
//[ast]~^^ ERROR use of moved value
3440
}
3541

3642
{
3743
let mut v: Spair = Spair { x: S(0), y: 0 };
3844
drop(v);
3945
v.x = S(1);
46+
//[nll]~^ ERROR assign to part of moved value
4047
v.y = 2;
4148
println!("{:?} {:?}", v.x, v.y);
49+
//[ast]~^ ERROR use of moved value
50+
//[ast]~^^ ERROR use of moved value
4251
}
4352
}

src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl Value {
1313
fn foo(val: Value) {
1414
let _reviewers_original: Vec<Value> = match val.as_array() {
1515
Some(array) => {
16-
*array
16+
*array //~ ERROR cannot move out of borrowed content
1717
}
1818
None => vec![]
1919
};

src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0507]: cannot move out of borrowed content
22
--> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:16:13
33
|
4-
LL | *array
4+
LL | *array //~ ERROR cannot move out of borrowed content
55
| ^^^^^^
66
| |
77
| cannot move out of borrowed content

src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.ast.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | x
99
|
1010

1111
error[E0595]: closure cannot assign to immutable argument `x`
12-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:29:22
12+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:32:22
1313
|
1414
LL | let mut c1 = |z: &'static mut isize| {
1515
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow mutably
@@ -19,31 +19,31 @@ LL | x
1919
|
2020

2121
error[E0595]: closure cannot assign to immutable argument `x`
22-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:9
22+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:46:9
2323
|
2424
LL | pub fn capture_assign_whole(x: (i32,)) {
2525
| - help: make this binding mutable: `mut x`
2626
LL | || { x = (1,); };
2727
| ^^ cannot borrow mutably
2828

2929
error[E0595]: closure cannot assign to immutable argument `x`
30-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:9
30+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:52:9
3131
|
3232
LL | pub fn capture_assign_part(x: (i32,)) {
3333
| - help: make this binding mutable: `mut x`
3434
LL | || { x.0 = 1; };
3535
| ^^ cannot borrow mutably
3636

3737
error[E0595]: closure cannot assign to immutable argument `x`
38-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:46:9
38+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:58:9
3939
|
4040
LL | pub fn capture_reborrow_whole(x: (i32,)) {
4141
| - help: make this binding mutable: `mut x`
4242
LL | || { &mut x; };
4343
| ^^ cannot borrow mutably
4444

4545
error[E0595]: closure cannot assign to immutable argument `x`
46-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:9
46+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:9
4747
|
4848
LL | pub fn capture_reborrow_part(x: (i32,)) {
4949
| - help: make this binding mutable: `mut x`

src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let mut c1 = |y: &'static mut isize| x = y;
88
| ^^^^^ cannot assign
99

1010
error[E0594]: cannot assign to `x`, as it is not declared as mutable
11-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:30:50
11+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:34:50
1212
|
1313
LL | pub fn ee(x: &'static mut isize) {
1414
| - help: consider changing this to be mutable: `mut x`
@@ -17,31 +17,31 @@ LL | let mut c2 = |y: &'static mut isize| x = y;
1717
| ^^^^^ cannot assign
1818

1919
error[E0594]: cannot assign to `x`, as it is not declared as mutable
20-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14
20+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:46:14
2121
|
2222
LL | pub fn capture_assign_whole(x: (i32,)) {
2323
| - help: consider changing this to be mutable: `mut x`
2424
LL | || { x = (1,); };
2525
| ^^^^^^^^ cannot assign
2626

2727
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
28-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:14
28+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:52:14
2929
|
3030
LL | pub fn capture_assign_part(x: (i32,)) {
3131
| - help: consider changing this to be mutable: `mut x`
3232
LL | || { x.0 = 1; };
3333
| ^^^^^^^ cannot assign
3434

3535
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
36-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:46:14
36+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:58:14
3737
|
3838
LL | pub fn capture_reborrow_whole(x: (i32,)) {
3939
| - help: consider changing this to be mutable: `mut x`
4040
LL | || { &mut x; };
4141
| ^^^^^^ cannot borrow as mutable
4242

4343
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
44-
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:14
44+
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:14
4545
|
4646
LL | pub fn capture_reborrow_part(x: (i32,)) {
4747
| - help: consider changing this to be mutable: `mut x`

0 commit comments

Comments
 (0)