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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 12 additions & 10 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 9 additions & 3 deletions
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

Lines changed: 11 additions & 3 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

0 commit comments

Comments
 (0)