Skip to content

Commit cd8392d

Browse files
committed
Fix tests
1 parent 43f9d0a commit cd8392d

31 files changed

+214
-142
lines changed

src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fn b() {
1313
//~| ERROR expected trait, found constant `BAR`
1414
//~| ERROR type provided when a constant was expected
1515
//~| WARN trait objects without an explicit `dyn` are deprecated
16+
//~| WARN this was previously accepted by the compiler
1617
}
1718
fn c() {
1819
foo::<3 + 3>(); //~ ERROR expressions must be enclosed in braces

src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr

+12-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | foo::<{ BAR + 3 }>();
1010
| ^ ^
1111

1212
error: expressions must be enclosed in braces to be used as const generic arguments
13-
--> $DIR/const-expression-suggest-missing-braces.rs:18:11
13+
--> $DIR/const-expression-suggest-missing-braces.rs:19:11
1414
|
1515
LL | foo::<3 + 3>();
1616
| ^^^^^
@@ -21,7 +21,7 @@ LL | foo::<{ 3 + 3 }>();
2121
| ^ ^
2222

2323
error: expected one of `,` or `>`, found `-`
24-
--> $DIR/const-expression-suggest-missing-braces.rs:21:15
24+
--> $DIR/const-expression-suggest-missing-braces.rs:22:15
2525
|
2626
LL | foo::<BAR - 3>();
2727
| ^ expected one of `,` or `>`
@@ -32,7 +32,7 @@ LL | foo::<{ BAR - 3 }>();
3232
| ^ ^
3333

3434
error: expected one of `,` or `>`, found `-`
35-
--> $DIR/const-expression-suggest-missing-braces.rs:24:15
35+
--> $DIR/const-expression-suggest-missing-braces.rs:25:15
3636
|
3737
LL | foo::<BAR - BAR>();
3838
| ^ expected one of `,` or `>`
@@ -43,7 +43,7 @@ LL | foo::<{ BAR - BAR }>();
4343
| ^ ^
4444

4545
error: expressions must be enclosed in braces to be used as const generic arguments
46-
--> $DIR/const-expression-suggest-missing-braces.rs:27:11
46+
--> $DIR/const-expression-suggest-missing-braces.rs:28:11
4747
|
4848
LL | foo::<100 - BAR>();
4949
| ^^^^^^^^^
@@ -54,7 +54,7 @@ LL | foo::<{ 100 - BAR }>();
5454
| ^ ^
5555

5656
error: expected one of `,` or `>`, found `(`
57-
--> $DIR/const-expression-suggest-missing-braces.rs:30:19
57+
--> $DIR/const-expression-suggest-missing-braces.rs:31:19
5858
|
5959
LL | foo::<bar<i32>()>();
6060
| ^ expected one of `,` or `>`
@@ -65,7 +65,7 @@ LL | foo::<{ bar<i32>() }>();
6565
| ^ ^
6666

6767
error: expected one of `,` or `>`, found `(`
68-
--> $DIR/const-expression-suggest-missing-braces.rs:33:21
68+
--> $DIR/const-expression-suggest-missing-braces.rs:34:21
6969
|
7070
LL | foo::<bar::<i32>()>();
7171
| ^ expected one of `,` or `>`
@@ -76,7 +76,7 @@ LL | foo::<{ bar::<i32>() }>();
7676
| ^ ^
7777

7878
error: expected one of `,` or `>`, found `(`
79-
--> $DIR/const-expression-suggest-missing-braces.rs:36:21
79+
--> $DIR/const-expression-suggest-missing-braces.rs:37:21
8080
|
8181
LL | foo::<bar::<i32>() + BAR>();
8282
| ^ expected one of `,` or `>`
@@ -87,7 +87,7 @@ LL | foo::<{ bar::<i32>() + BAR }>();
8787
| ^ ^
8888

8989
error: expected one of `,` or `>`, found `(`
90-
--> $DIR/const-expression-suggest-missing-braces.rs:39:21
90+
--> $DIR/const-expression-suggest-missing-braces.rs:40:21
9191
|
9292
LL | foo::<bar::<i32>() - BAR>();
9393
| ^ expected one of `,` or `>`
@@ -98,7 +98,7 @@ LL | foo::<{ bar::<i32>() - BAR }>();
9898
| ^ ^
9999

100100
error: expected one of `,` or `>`, found `-`
101-
--> $DIR/const-expression-suggest-missing-braces.rs:42:15
101+
--> $DIR/const-expression-suggest-missing-braces.rs:43:15
102102
|
103103
LL | foo::<BAR - bar::<i32>()>();
104104
| ^ expected one of `,` or `>`
@@ -109,7 +109,7 @@ LL | foo::<{ BAR - bar::<i32>() }>();
109109
| ^ ^
110110

111111
error: expected one of `,` or `>`, found `-`
112-
--> $DIR/const-expression-suggest-missing-braces.rs:45:15
112+
--> $DIR/const-expression-suggest-missing-braces.rs:46:15
113113
|
114114
LL | foo::<BAR - bar::<i32>()>();
115115
| ^ expected one of `,` or `>`
@@ -138,6 +138,8 @@ LL | foo::<BAR + BAR>();
138138
| ^^^^^^^^^ help: use `dyn`: `dyn BAR + BAR`
139139
|
140140
= note: `#[warn(bare_trait_objects)]` on by default
141+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
142+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
141143

142144
error[E0747]: type provided when a constant was expected
143145
--> $DIR/const-expression-suggest-missing-braces.rs:11:11

src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
1111
//~^ ERROR: lifetime in trait object type must be followed by `+`
1212
//~| ERROR: parenthesized generic arguments cannot be used
1313
//~| WARNING: trait objects without an explicit `dyn` are deprecated
14+
//~| WARNING: this was previously accepted by the compiler
1415

1516
fn main() {}

src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
2626
| ^^ help: use `dyn`: `dyn 'a`
2727
|
2828
= note: `#[warn(bare_trait_objects)]` on by default
29+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
30+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
2931

3032
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
3133
--> $DIR/gat-trait-path-parenthesised-args.rs:5:8

src/test/ui/lint/bare-trait-objects-path.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ trait Dyn {}
1111
impl Assoc for dyn Dyn {}
1212

1313
fn main() {
14-
Dyn::func(); //~ WARN trait objects without an explicit `dyn` are deprecated
15-
::Dyn::func(); //~ WARN trait objects without an explicit `dyn` are deprecated
16-
Dyn::CONST; //~ WARN trait objects without an explicit `dyn` are deprecated
14+
Dyn::func();
15+
//~^ WARN trait objects without an explicit `dyn` are deprecated
16+
//~| WARN this was previously accepted by the compiler
17+
::Dyn::func();
18+
//~^ WARN trait objects without an explicit `dyn` are deprecated
19+
//~| WARN this was previously accepted by the compiler
20+
Dyn::CONST;
21+
//~^ WARN trait objects without an explicit `dyn` are deprecated
22+
//~| WARN this was previously accepted by the compiler
1723
let _: Dyn::Ty; //~ ERROR ambiguous associated type
1824
}

src/test/ui/lint/bare-trait-objects-path.stderr

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0223]: ambiguous associated type
2-
--> $DIR/bare-trait-objects-path.rs:17:12
2+
--> $DIR/bare-trait-objects-path.rs:23:12
33
|
44
LL | let _: Dyn::Ty;
55
| ^^^^^^^ help: use fully-qualified syntax: `<dyn Dyn as Trait>::Ty`
@@ -11,18 +11,26 @@ LL | Dyn::func();
1111
| ^^^ help: use `dyn`: `<dyn Dyn>`
1212
|
1313
= note: `#[warn(bare_trait_objects)]` on by default
14+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
15+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1416

1517
warning: trait objects without an explicit `dyn` are deprecated
16-
--> $DIR/bare-trait-objects-path.rs:15:5
18+
--> $DIR/bare-trait-objects-path.rs:17:5
1719
|
1820
LL | ::Dyn::func();
1921
| ^^^^^ help: use `dyn`: `<dyn (::Dyn)>`
22+
|
23+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
24+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
2025

2126
warning: trait objects without an explicit `dyn` are deprecated
22-
--> $DIR/bare-trait-objects-path.rs:16:5
27+
--> $DIR/bare-trait-objects-path.rs:20:5
2328
|
2429
LL | Dyn::CONST;
2530
| ^^^ help: use `dyn`: `<dyn Dyn>`
31+
|
32+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
33+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
2634

2735
error: aborting due to previous error; 3 warnings emitted
2836

src/test/ui/lint/inclusive-range-pattern-syntax.fixed

+2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ fn main() {
88
match despondency {
99
1..=2 => {}
1010
//~^ WARN `...` range patterns are deprecated
11+
//~| WARN this was previously accepted by the compiler
1112
_ => {}
1213
}
1314

1415
match &despondency {
1516
&(1..=2) => {}
1617
//~^ WARN `...` range patterns are deprecated
18+
//~| WARN this was previously accepted by the compiler
1719
_ => {}
1820
}
1921
}

src/test/ui/lint/inclusive-range-pattern-syntax.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ fn main() {
88
match despondency {
99
1...2 => {}
1010
//~^ WARN `...` range patterns are deprecated
11+
//~| WARN this was previously accepted by the compiler
1112
_ => {}
1213
}
1314

1415
match &despondency {
1516
&1...2 => {}
1617
//~^ WARN `...` range patterns are deprecated
18+
//~| WARN this was previously accepted by the compiler
1719
_ => {}
1820
}
1921
}

src/test/ui/lint/inclusive-range-pattern-syntax.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ note: the lint level is defined here
99
|
1010
LL | #![warn(ellipsis_inclusive_range_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
13+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1214

1315
warning: `...` range patterns are deprecated
14-
--> $DIR/inclusive-range-pattern-syntax.rs:15:9
16+
--> $DIR/inclusive-range-pattern-syntax.rs:16:9
1517
|
1618
LL | &1...2 => {}
1719
| ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)`
20+
|
21+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
22+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1823

1924
warning: 2 warnings emitted
2025

src/test/ui/parser/issue-68890-2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ type X<'a> = (?'a) +;
44
//~^ ERROR `?` may only modify trait bounds, not lifetime bounds
55
//~| ERROR at least one trait is required for an object type
66
//~| WARN trait objects without an explicit `dyn` are deprecated
7+
//~| WARN this was previously accepted by the compiler

src/test/ui/parser/issue-68890-2.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ LL | type X<'a> = (?'a) +;
1111
| ^^^^^^^ help: use `dyn`: `dyn (?'a) +`
1212
|
1313
= note: `#[warn(bare_trait_objects)]` on by default
14+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
15+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1416

1517
error[E0224]: at least one trait is required for an object type
1618
--> $DIR/issue-68890-2.rs:3:14

src/test/ui/parser/issue-73568-lifetime-after-mut.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ mac!('a);
1414
fn y<'a>(y: &mut 'a + Send) {
1515
//~^ ERROR expected a path on the left-hand side of `+`, not `&mut 'a`
1616
//~| WARNING trait objects without an explicit `dyn` are deprecated
17+
//~| WARN this was previously accepted by the compiler
1718
//~| ERROR at least one trait is required for an object type
1819
let z = y as &mut 'a + Send;
1920
//~^ ERROR expected value, found trait `Send`
2021
//~| WARNING trait objects without an explicit `dyn` are deprecated
22+
//~| WARN this was previously accepted by the compiler
2123
}

src/test/ui/parser/issue-73568-lifetime-after-mut.stderr

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LL | mac!('a);
2222
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2323

2424
error[E0423]: expected value, found trait `Send`
25-
--> $DIR/issue-73568-lifetime-after-mut.rs:18:28
25+
--> $DIR/issue-73568-lifetime-after-mut.rs:19:28
2626
|
2727
LL | let z = y as &mut 'a + Send;
2828
| ^^^^ not a value
@@ -34,12 +34,17 @@ LL | fn y<'a>(y: &mut 'a + Send) {
3434
| ^^ help: use `dyn`: `dyn 'a`
3535
|
3636
= note: `#[warn(bare_trait_objects)]` on by default
37+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
38+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
3739

3840
warning: trait objects without an explicit `dyn` are deprecated
39-
--> $DIR/issue-73568-lifetime-after-mut.rs:18:23
41+
--> $DIR/issue-73568-lifetime-after-mut.rs:19:23
4042
|
4143
LL | let z = y as &mut 'a + Send;
4244
| ^^ help: use `dyn`: `dyn 'a`
45+
|
46+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
47+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
4348

4449
error[E0224]: at least one trait is required for an object type
4550
--> $DIR/issue-73568-lifetime-after-mut.rs:14:18

src/test/ui/parser/macro/trait-object-macro-matcher.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ fn main() {
1212
//~^ ERROR lifetime in trait object type must be followed by `+`
1313
//~| ERROR at least one trait is required for an object type
1414
//~| WARN trait objects without an explicit `dyn` are deprecated
15+
//~| WARN this was previously accepted by the compiler
1516
}

src/test/ui/parser/macro/trait-object-macro-matcher.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ LL | m!('static);
1111
| ^^^^^^^ help: use `dyn`: `dyn 'static`
1212
|
1313
= note: `#[warn(bare_trait_objects)]` on by default
14+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
15+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1416

1517
error[E0224]: at least one trait is required for an object type
1618
--> $DIR/trait-object-macro-matcher.rs:11:8

src/test/ui/parser/recover-range-pats.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,32 @@ fn inclusive_from_to() {
3939
}
4040

4141
fn inclusive2_from_to() {
42-
if let 0...3 = 0 {} //~ ERROR `...` range patterns are deprecated
43-
if let 0...Y = 0 {} //~ ERROR `...` range patterns are deprecated
44-
if let X...3 = 0 {} //~ ERROR `...` range patterns are deprecated
45-
if let X...Y = 0 {} //~ ERROR `...` range patterns are deprecated
42+
if let 0...3 = 0 {}
43+
//~^ ERROR `...` range patterns are deprecated
44+
//~| WARN this was previously accepted by the compiler
45+
if let 0...Y = 0 {}
46+
//~^ ERROR `...` range patterns are deprecated
47+
//~| WARN this was previously accepted by the compiler
48+
if let X...3 = 0 {}
49+
//~^ ERROR `...` range patterns are deprecated
50+
//~| WARN this was previously accepted by the compiler
51+
if let X...Y = 0 {}
52+
//~^ ERROR `...` range patterns are deprecated
53+
//~| WARN this was previously accepted by the compiler
4654
if let true...Y = 0 {} //~ ERROR only `char` and numeric types
4755
//~^ ERROR `...` range patterns are deprecated
56+
//~| WARN this was previously accepted by the compiler
4857
if let X...true = 0 {} //~ ERROR only `char` and numeric types
4958
//~^ ERROR `...` range patterns are deprecated
59+
//~| WARN this was previously accepted by the compiler
5060
if let .0...Y = 0 {} //~ ERROR mismatched types
5161
//~^ ERROR float literals must have an integer part
62+
//~| WARN this was previously accepted by the compiler
5263
//~| ERROR `...` range patterns are deprecated
5364
if let X... .0 = 0 {} //~ ERROR mismatched types
5465
//~^ ERROR float literals must have an integer part
5566
//~| ERROR `...` range patterns are deprecated
67+
//~| WARN this was previously accepted by the compiler
5668
}
5769

5870
fn exclusive_from() {
@@ -125,6 +137,7 @@ fn with_macro_expr_var() {
125137
let $e1..$e2;
126138
let $e1...$e2;
127139
//~^ ERROR `...` range patterns are deprecated
140+
//~| WARN this was previously accepted by the compiler
128141
let $e1..=$e2;
129142
}
130143
}

0 commit comments

Comments
 (0)