diff options
| author | Ryan Levick <me@ryanlevick.com> | 2021-04-16 11:06:51 +0200 |
|---|---|---|
| committer | Ryan Levick <me@ryanlevick.com> | 2021-04-16 11:06:51 +0200 |
| commit | cd8392dd9932c30f5e6e7b42a1f3ab9e90ab11f8 (patch) | |
| tree | 592d7dbcc5d6eb1ca264d961a168780e65e108b2 | |
| parent | 43f9d0ae7e0733b1e4e7ad84165ddd57144f2db7 (diff) | |
| download | rust-cd8392dd9932c30f5e6e7b42a1f3ab9e90ab11f8.tar.gz rust-cd8392dd9932c30f5e6e7b42a1f3ab9e90ab11f8.zip | |
Fix tests
31 files changed, 214 insertions, 142 deletions
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs index f8b9d7adbfe..d845e00694a 100644 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs +++ b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs @@ -13,6 +13,7 @@ fn b() { //~| ERROR expected trait, found constant `BAR` //~| ERROR type provided when a constant was expected //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler } fn c() { foo::<3 + 3>(); //~ ERROR expressions must be enclosed in braces diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr index ad451fcf65d..857498a1111 100644 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr +++ b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr @@ -10,7 +10,7 @@ LL | foo::<{ BAR + 3 }>(); | ^ ^ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-suggest-missing-braces.rs:18:11 + --> $DIR/const-expression-suggest-missing-braces.rs:19:11 | LL | foo::<3 + 3>(); | ^^^^^ @@ -21,7 +21,7 @@ LL | foo::<{ 3 + 3 }>(); | ^ ^ error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:21:15 + --> $DIR/const-expression-suggest-missing-braces.rs:22:15 | LL | foo::<BAR - 3>(); | ^ expected one of `,` or `>` @@ -32,7 +32,7 @@ LL | foo::<{ BAR - 3 }>(); | ^ ^ error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:24:15 + --> $DIR/const-expression-suggest-missing-braces.rs:25:15 | LL | foo::<BAR - BAR>(); | ^ expected one of `,` or `>` @@ -43,7 +43,7 @@ LL | foo::<{ BAR - BAR }>(); | ^ ^ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-suggest-missing-braces.rs:27:11 + --> $DIR/const-expression-suggest-missing-braces.rs:28:11 | LL | foo::<100 - BAR>(); | ^^^^^^^^^ @@ -54,7 +54,7 @@ LL | foo::<{ 100 - BAR }>(); | ^ ^ error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:30:19 + --> $DIR/const-expression-suggest-missing-braces.rs:31:19 | LL | foo::<bar<i32>()>(); | ^ expected one of `,` or `>` @@ -65,7 +65,7 @@ LL | foo::<{ bar<i32>() }>(); | ^ ^ error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:33:21 + --> $DIR/const-expression-suggest-missing-braces.rs:34:21 | LL | foo::<bar::<i32>()>(); | ^ expected one of `,` or `>` @@ -76,7 +76,7 @@ LL | foo::<{ bar::<i32>() }>(); | ^ ^ error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:36:21 + --> $DIR/const-expression-suggest-missing-braces.rs:37:21 | LL | foo::<bar::<i32>() + BAR>(); | ^ expected one of `,` or `>` @@ -87,7 +87,7 @@ LL | foo::<{ bar::<i32>() + BAR }>(); | ^ ^ error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:39:21 + --> $DIR/const-expression-suggest-missing-braces.rs:40:21 | LL | foo::<bar::<i32>() - BAR>(); | ^ expected one of `,` or `>` @@ -98,7 +98,7 @@ LL | foo::<{ bar::<i32>() - BAR }>(); | ^ ^ error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:42:15 + --> $DIR/const-expression-suggest-missing-braces.rs:43:15 | LL | foo::<BAR - bar::<i32>()>(); | ^ expected one of `,` or `>` @@ -109,7 +109,7 @@ LL | foo::<{ BAR - bar::<i32>() }>(); | ^ ^ error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:45:15 + --> $DIR/const-expression-suggest-missing-braces.rs:46:15 | LL | foo::<BAR - bar::<i32>()>(); | ^ expected one of `,` or `>` @@ -138,6 +138,8 @@ LL | foo::<BAR + BAR>(); | ^^^^^^^^^ help: use `dyn`: `dyn BAR + BAR` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0747]: type provided when a constant was expected --> $DIR/const-expression-suggest-missing-braces.rs:11:11 diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs index bb1f27a17ca..40ed42c9ce0 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs +++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs @@ -11,5 +11,6 @@ fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} //~^ ERROR: lifetime in trait object type must be followed by `+` //~| ERROR: parenthesized generic arguments cannot be used //~| WARNING: trait objects without an explicit `dyn` are deprecated + //~| WARNING: this was previously accepted by the compiler fn main() {} diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index 20cb6d88287..0e95c54d811 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -26,6 +26,8 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | ^^ help: use `dyn`: `dyn 'a` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/gat-trait-path-parenthesised-args.rs:5:8 diff --git a/src/test/ui/lint/bare-trait-objects-path.rs b/src/test/ui/lint/bare-trait-objects-path.rs index 4c961e998df..74f838e9ed1 100644 --- a/src/test/ui/lint/bare-trait-objects-path.rs +++ b/src/test/ui/lint/bare-trait-objects-path.rs @@ -11,8 +11,14 @@ trait Dyn {} impl Assoc for dyn Dyn {} fn main() { - Dyn::func(); //~ WARN trait objects without an explicit `dyn` are deprecated - ::Dyn::func(); //~ WARN trait objects without an explicit `dyn` are deprecated - Dyn::CONST; //~ WARN trait objects without an explicit `dyn` are deprecated + Dyn::func(); + //~^ WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler + ::Dyn::func(); + //~^ WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler + Dyn::CONST; + //~^ WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler let _: Dyn::Ty; //~ ERROR ambiguous associated type } diff --git a/src/test/ui/lint/bare-trait-objects-path.stderr b/src/test/ui/lint/bare-trait-objects-path.stderr index 0a2dc585828..55c9ea234de 100644 --- a/src/test/ui/lint/bare-trait-objects-path.stderr +++ b/src/test/ui/lint/bare-trait-objects-path.stderr @@ -1,5 +1,5 @@ error[E0223]: ambiguous associated type - --> $DIR/bare-trait-objects-path.rs:17:12 + --> $DIR/bare-trait-objects-path.rs:23:12 | LL | let _: Dyn::Ty; | ^^^^^^^ help: use fully-qualified syntax: `<dyn Dyn as Trait>::Ty` @@ -11,18 +11,26 @@ LL | Dyn::func(); | ^^^ help: use `dyn`: `<dyn Dyn>` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/bare-trait-objects-path.rs:15:5 + --> $DIR/bare-trait-objects-path.rs:17:5 | LL | ::Dyn::func(); | ^^^^^ help: use `dyn`: `<dyn (::Dyn)>` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/bare-trait-objects-path.rs:16:5 + --> $DIR/bare-trait-objects-path.rs:20:5 | LL | Dyn::CONST; | ^^^ help: use `dyn`: `<dyn Dyn>` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: aborting due to previous error; 3 warnings emitted diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.fixed b/src/test/ui/lint/inclusive-range-pattern-syntax.fixed index d6e5033a0c4..a1b738e33fa 100644 --- a/src/test/ui/lint/inclusive-range-pattern-syntax.fixed +++ b/src/test/ui/lint/inclusive-range-pattern-syntax.fixed @@ -8,12 +8,14 @@ fn main() { match despondency { 1..=2 => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler _ => {} } match &despondency { &(1..=2) => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler _ => {} } } diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.rs b/src/test/ui/lint/inclusive-range-pattern-syntax.rs index 773eea14fd7..d3ebbf38e1c 100644 --- a/src/test/ui/lint/inclusive-range-pattern-syntax.rs +++ b/src/test/ui/lint/inclusive-range-pattern-syntax.rs @@ -8,12 +8,14 @@ fn main() { match despondency { 1...2 => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler _ => {} } match &despondency { &1...2 => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler _ => {} } } diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr index 19fe9ed892a..ba4ae208e39 100644 --- a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr +++ b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr @@ -9,12 +9,17 @@ note: the lint level is defined here | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: `...` range patterns are deprecated - --> $DIR/inclusive-range-pattern-syntax.rs:15:9 + --> $DIR/inclusive-range-pattern-syntax.rs:16:9 | LL | &1...2 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: 2 warnings emitted diff --git a/src/test/ui/parser/issue-68890-2.rs b/src/test/ui/parser/issue-68890-2.rs index ae022460468..88527cc8783 100644 --- a/src/test/ui/parser/issue-68890-2.rs +++ b/src/test/ui/parser/issue-68890-2.rs @@ -4,3 +4,4 @@ type X<'a> = (?'a) +; //~^ ERROR `?` may only modify trait bounds, not lifetime bounds //~| ERROR at least one trait is required for an object type //~| WARN trait objects without an explicit `dyn` are deprecated +//~| WARN this was previously accepted by the compiler diff --git a/src/test/ui/parser/issue-68890-2.stderr b/src/test/ui/parser/issue-68890-2.stderr index e51c2c0e842..37f38365b01 100644 --- a/src/test/ui/parser/issue-68890-2.stderr +++ b/src/test/ui/parser/issue-68890-2.stderr @@ -11,6 +11,8 @@ LL | type X<'a> = (?'a) +; | ^^^^^^^ help: use `dyn`: `dyn (?'a) +` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0224]: at least one trait is required for an object type --> $DIR/issue-68890-2.rs:3:14 diff --git a/src/test/ui/parser/issue-73568-lifetime-after-mut.rs b/src/test/ui/parser/issue-73568-lifetime-after-mut.rs index 0b10a5f6f4e..0733b2d2df7 100644 --- a/src/test/ui/parser/issue-73568-lifetime-after-mut.rs +++ b/src/test/ui/parser/issue-73568-lifetime-after-mut.rs @@ -14,8 +14,10 @@ mac!('a); fn y<'a>(y: &mut 'a + Send) { //~^ ERROR expected a path on the left-hand side of `+`, not `&mut 'a` //~| WARNING trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler //~| ERROR at least one trait is required for an object type let z = y as &mut 'a + Send; //~^ ERROR expected value, found trait `Send` //~| WARNING trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler } diff --git a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr index abb64f7e490..9b05383dd7d 100644 --- a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr +++ b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr @@ -22,7 +22,7 @@ LL | mac!('a); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0423]: expected value, found trait `Send` - --> $DIR/issue-73568-lifetime-after-mut.rs:18:28 + --> $DIR/issue-73568-lifetime-after-mut.rs:19:28 | LL | let z = y as &mut 'a + Send; | ^^^^ not a value @@ -34,12 +34,17 @@ LL | fn y<'a>(y: &mut 'a + Send) { | ^^ help: use `dyn`: `dyn 'a` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-73568-lifetime-after-mut.rs:18:23 + --> $DIR/issue-73568-lifetime-after-mut.rs:19:23 | LL | let z = y as &mut 'a + Send; | ^^ help: use `dyn`: `dyn 'a` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0224]: at least one trait is required for an object type --> $DIR/issue-73568-lifetime-after-mut.rs:14:18 diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.rs b/src/test/ui/parser/macro/trait-object-macro-matcher.rs index 170ac22780b..0428ea0e2c1 100644 --- a/src/test/ui/parser/macro/trait-object-macro-matcher.rs +++ b/src/test/ui/parser/macro/trait-object-macro-matcher.rs @@ -12,4 +12,5 @@ fn main() { //~^ ERROR lifetime in trait object type must be followed by `+` //~| ERROR at least one trait is required for an object type //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler } diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr index b12eedf3581..8ae5611d89d 100644 --- a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr +++ b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr @@ -11,6 +11,8 @@ LL | m!('static); | ^^^^^^^ help: use `dyn`: `dyn 'static` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0224]: at least one trait is required for an object type --> $DIR/trait-object-macro-matcher.rs:11:8 diff --git a/src/test/ui/parser/recover-range-pats.rs b/src/test/ui/parser/recover-range-pats.rs index 7412b624b09..a10add6d9e5 100644 --- a/src/test/ui/parser/recover-range-pats.rs +++ b/src/test/ui/parser/recover-range-pats.rs @@ -39,20 +39,32 @@ fn inclusive_from_to() { } fn inclusive2_from_to() { - if let 0...3 = 0 {} //~ ERROR `...` range patterns are deprecated - if let 0...Y = 0 {} //~ ERROR `...` range patterns are deprecated - if let X...3 = 0 {} //~ ERROR `...` range patterns are deprecated - if let X...Y = 0 {} //~ ERROR `...` range patterns are deprecated + if let 0...3 = 0 {} + //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler + if let 0...Y = 0 {} + //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler + if let X...3 = 0 {} + //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler + if let X...Y = 0 {} + //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler if let true...Y = 0 {} //~ ERROR only `char` and numeric types //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler if let X...true = 0 {} //~ ERROR only `char` and numeric types //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler if let .0...Y = 0 {} //~ ERROR mismatched types //~^ ERROR float literals must have an integer part + //~| WARN this was previously accepted by the compiler //~| ERROR `...` range patterns are deprecated if let X... .0 = 0 {} //~ ERROR mismatched types //~^ ERROR float literals must have an integer part //~| ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler } fn exclusive_from() { @@ -125,6 +137,7 @@ fn with_macro_expr_var() { let $e1..$e2; let $e1...$e2; //~^ ERROR `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler let $e1..=$e2; } } diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index e351a9783bf..45f6b111e25 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -23,25 +23,25 @@ LL | if let X..=.0 = 0 {} | ^^ help: must have an integer part: `0.0` error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:50:12 + --> $DIR/recover-range-pats.rs:60:12 | LL | if let .0...Y = 0 {} | ^^ help: must have an integer part: `0.0` error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:53:17 + --> $DIR/recover-range-pats.rs:64:17 | LL | if let X... .0 = 0 {} | ^^ help: must have an integer part: `0.0` error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:63:12 + --> $DIR/recover-range-pats.rs:75:12 | LL | if let .0.. = 0 {} | ^^ help: must have an integer part: `0.0` error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:69:13 + --> $DIR/recover-range-pats.rs:81:13 | LL | if let 0..= = 0 {} | ^^^ help: use `..` instead @@ -49,7 +49,7 @@ LL | if let 0..= = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:70:13 + --> $DIR/recover-range-pats.rs:82:13 | LL | if let X..= = 0 {} | ^^^ help: use `..` instead @@ -57,7 +57,7 @@ LL | if let X..= = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:71:16 + --> $DIR/recover-range-pats.rs:83:16 | LL | if let true..= = 0 {} | ^^^ help: use `..` instead @@ -65,13 +65,13 @@ LL | if let true..= = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:73:12 + --> $DIR/recover-range-pats.rs:85:12 | LL | if let .0..= = 0 {} | ^^ help: must have an integer part: `0.0` error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:73:14 + --> $DIR/recover-range-pats.rs:85:14 | LL | if let .0..= = 0 {} | ^^^ help: use `..` instead @@ -79,7 +79,7 @@ LL | if let .0..= = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:79:13 + --> $DIR/recover-range-pats.rs:91:13 | LL | if let 0... = 0 {} | ^^^ help: use `..` instead @@ -87,7 +87,7 @@ LL | if let 0... = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:80:13 + --> $DIR/recover-range-pats.rs:92:13 | LL | if let X... = 0 {} | ^^^ help: use `..` instead @@ -95,7 +95,7 @@ LL | if let X... = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:81:16 + --> $DIR/recover-range-pats.rs:93:16 | LL | if let true... = 0 {} | ^^^ help: use `..` instead @@ -103,13 +103,13 @@ LL | if let true... = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:83:12 + --> $DIR/recover-range-pats.rs:95:12 | LL | if let .0... = 0 {} | ^^ help: must have an integer part: `0.0` error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:83:14 + --> $DIR/recover-range-pats.rs:95:14 | LL | if let .0... = 0 {} | ^^^ help: use `..` instead @@ -117,49 +117,49 @@ LL | if let .0... = 0 {} = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:93:15 + --> $DIR/recover-range-pats.rs:105:15 | LL | if let .. .0 = 0 {} | ^^ help: must have an integer part: `0.0` error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:103:15 + --> $DIR/recover-range-pats.rs:115:15 | LL | if let ..=.0 = 0 {} | ^^ help: must have an integer part: `0.0` error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:109:12 + --> $DIR/recover-range-pats.rs:121:12 | LL | if let ...3 = 0 {} | ^^^ help: use `..=` instead error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:111:12 + --> $DIR/recover-range-pats.rs:123:12 | LL | if let ...Y = 0 {} | ^^^ help: use `..=` instead error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:113:12 + --> $DIR/recover-range-pats.rs:125:12 | LL | if let ...true = 0 {} | ^^^ help: use `..=` instead error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:116:15 + --> $DIR/recover-range-pats.rs:128:15 | LL | if let ....3 = 0 {} | ^^ help: must have an integer part: `0.3` error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:116:12 + --> $DIR/recover-range-pats.rs:128:12 | LL | if let ....3 = 0 {} | ^^^ help: use `..=` instead error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:137:17 + --> $DIR/recover-range-pats.rs:150:17 | LL | let ...$e; | ^^^ help: use `..=` instead @@ -170,7 +170,7 @@ LL | mac!(0); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:141:19 + --> $DIR/recover-range-pats.rs:154:19 | LL | let $e...; | ^^^ help: use `..` instead @@ -182,7 +182,7 @@ LL | mac!(0); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:142:19 + --> $DIR/recover-range-pats.rs:155:19 | LL | let $e..=; | ^^^ help: use `..` instead @@ -204,51 +204,74 @@ note: the lint level is defined here | LL | #![deny(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:43:13 + --> $DIR/recover-range-pats.rs:45:13 | LL | if let 0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:44:13 + --> $DIR/recover-range-pats.rs:48:13 | LL | if let X...3 = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:45:13 + --> $DIR/recover-range-pats.rs:51:13 | LL | if let X...Y = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:46:16 + --> $DIR/recover-range-pats.rs:54:16 | LL | if let true...Y = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:48:13 + --> $DIR/recover-range-pats.rs:57:13 | LL | if let X...true = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:50:14 + --> $DIR/recover-range-pats.rs:60:14 | LL | if let .0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:53:13 + --> $DIR/recover-range-pats.rs:64:13 | LL | if let X... .0 = 0 {} | ^^^ help: use `..=` for an inclusive range + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:126:20 + --> $DIR/recover-range-pats.rs:138:20 | LL | let $e1...$e2; | ^^^ help: use `..=` for an inclusive range @@ -256,6 +279,8 @@ LL | let $e1...$e2; LL | mac2!(0, 1); | ------------ in this macro invocation | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0029]: only `char` and numeric types are allowed in range patterns @@ -325,7 +350,7 @@ LL | if let X..=.0 = 0 {} | this is of type `u8` error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:46:12 + --> $DIR/recover-range-pats.rs:54:12 | LL | if let true...Y = 0 {} | ^^^^ - this is of type `u8` @@ -333,7 +358,7 @@ LL | if let true...Y = 0 {} | this is of type `bool` but it should be `char` or numeric error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:48:16 + --> $DIR/recover-range-pats.rs:57:16 | LL | if let X...true = 0 {} | - ^^^^ this is of type `bool` but it should be `char` or numeric @@ -341,7 +366,7 @@ LL | if let X...true = 0 {} | this is of type `u8` error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:50:12 + --> $DIR/recover-range-pats.rs:60:12 | LL | if let .0...Y = 0 {} | ^^ - this is of type `u8` @@ -349,7 +374,7 @@ LL | if let .0...Y = 0 {} | expected integer, found floating-point number error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:53:17 + --> $DIR/recover-range-pats.rs:64:17 | LL | if let X... .0 = 0 {} | - ^^ - this expression has type `u8` @@ -358,73 +383,73 @@ LL | if let X... .0 = 0 {} | this is of type `u8` error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:61:12 + --> $DIR/recover-range-pats.rs:73:12 | LL | if let true.. = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:63:12 + --> $DIR/recover-range-pats.rs:75:12 | LL | if let .0.. = 0 {} | ^^ expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:71:12 + --> $DIR/recover-range-pats.rs:83:12 | LL | if let true..= = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:73:12 + --> $DIR/recover-range-pats.rs:85:12 | LL | if let .0..= = 0 {} | ^^ expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:81:12 + --> $DIR/recover-range-pats.rs:93:12 | LL | if let true... = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:83:12 + --> $DIR/recover-range-pats.rs:95:12 | LL | if let .0... = 0 {} | ^^ expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:91:14 + --> $DIR/recover-range-pats.rs:103:14 | LL | if let ..true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:93:15 + --> $DIR/recover-range-pats.rs:105:15 | LL | if let .. .0 = 0 {} | ^^ expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:101:15 + --> $DIR/recover-range-pats.rs:113:15 | LL | if let ..=true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:103:15 + --> $DIR/recover-range-pats.rs:115:15 | LL | if let ..=.0 = 0 {} | ^^ expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:113:15 + --> $DIR/recover-range-pats.rs:125:15 | LL | if let ...true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:116:15 + --> $DIR/recover-range-pats.rs:128:15 | LL | if let ....3 = 0 {} | ^^ expected integer, found floating-point number diff --git a/src/test/ui/parser/trait-object-trait-parens.rs b/src/test/ui/parser/trait-object-trait-parens.rs index 9fbc938c4dc..7d55da7d097 100644 --- a/src/test/ui/parser/trait-object-trait-parens.rs +++ b/src/test/ui/parser/trait-object-trait-parens.rs @@ -9,12 +9,15 @@ fn main() { //~^ ERROR `?Trait` is not permitted in trait object types //~| ERROR only auto traits can be used as additional traits //~| WARN trait objects without an explicit `dyn` are deprecated - let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Obj)>; + //~| WARN this was previously accepted by the compiler + let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; //~^ ERROR `?Trait` is not permitted in trait object types //~| ERROR only auto traits can be used as additional traits //~| WARN trait objects without an explicit `dyn` are deprecated - let _: Box<(for<'a> Trait<'a>) + (Obj) + (?Sized)>; + //~| WARN this was previously accepted by the compiler + let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; //~^ ERROR `?Trait` is not permitted in trait object types //~| ERROR only auto traits can be used as additional traits //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler } diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr index 6efbfad8f38..79b6892dc07 100644 --- a/src/test/ui/parser/trait-object-trait-parens.stderr +++ b/src/test/ui/parser/trait-object-trait-parens.stderr @@ -5,16 +5,16 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ^^^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/trait-object-trait-parens.rs:12:17 + --> $DIR/trait-object-trait-parens.rs:13:16 | -LL | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Obj)>; - | ^^^^^^ +LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; + | ^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/trait-object-trait-parens.rs:16:46 + --> $DIR/trait-object-trait-parens.rs:18:44 | -LL | let _: Box<(for<'a> Trait<'a>) + (Obj) + (?Sized)>; - | ^^^^^^^^ +LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; + | ^^^^^^^^ warning: trait objects without an explicit `dyn` are deprecated --> $DIR/trait-object-trait-parens.rs:8:16 @@ -23,18 +23,26 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-object-trait-parens.rs:12:16 + --> $DIR/trait-object-trait-parens.rs:13:16 | -LL | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Obj)>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn (?Sized) + (for<'a> Trait<'a>) + (Obj)` +LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn ?Sized + (for<'a> Trait<'a>) + (Obj)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-object-trait-parens.rs:16:16 + --> $DIR/trait-object-trait-parens.rs:18:16 + | +LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn for<'a> Trait<'a> + (Obj) + (?Sized)` | -LL | let _: Box<(for<'a> Trait<'a>) + (Obj) + (?Sized)>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn (for<'a> Trait<'a>) + (Obj) + (?Sized)` + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-trait-parens.rs:8:35 @@ -48,23 +56,23 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-object-trait-parens.rs:12:49 + --> $DIR/trait-object-trait-parens.rs:13:47 | -LL | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Obj)>; - | ------------------- ^^^^^ additional non-auto trait - | | - | first non-auto trait +LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; + | ------------------- ^^^^^ additional non-auto trait + | | + | first non-auto trait | = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: for<'a> Trait<'a> + Obj {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-object-trait-parens.rs:16:38 + --> $DIR/trait-object-trait-parens.rs:18:36 | -LL | let _: Box<(for<'a> Trait<'a>) + (Obj) + (?Sized)>; - | ----------------- ^^^^^ additional non-auto trait - | | - | first non-auto trait +LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; + | ----------------- ^^^^^ additional non-auto trait + | | + | first non-auto trait | = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: for<'a> Trait<'a> + Obj {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.fixed b/src/test/ui/range/range-inclusive-pattern-precedence.fixed index 22ab6c755be..6c012099676 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence.fixed +++ b/src/test/ui/range/range-inclusive-pattern-precedence.fixed @@ -10,10 +10,11 @@ pub fn main() { match &12 { &(0..=9) => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler //~| HELP use `..=` for an inclusive range &(10 ..=15) => {} //~^ ERROR the range pattern here has ambiguous interpretation - //~^^ HELP add parentheses to clarify the precedence + //~| HELP add parentheses to clarify the precedence &(16..=20) => {} _ => {} } diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.rs b/src/test/ui/range/range-inclusive-pattern-precedence.rs index f38a7920c94..ce763ba2677 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence.rs +++ b/src/test/ui/range/range-inclusive-pattern-precedence.rs @@ -10,10 +10,11 @@ pub fn main() { match &12 { &0...9 => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler //~| HELP use `..=` for an inclusive range &10..=15 => {} //~^ ERROR the range pattern here has ambiguous interpretation - //~^^ HELP add parentheses to clarify the precedence + //~| HELP add parentheses to clarify the precedence &(16..=20) => {} _ => {} } diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.stderr b/src/test/ui/range/range-inclusive-pattern-precedence.stderr index 853141969c2..ffb833535c2 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence.stderr +++ b/src/test/ui/range/range-inclusive-pattern-precedence.stderr @@ -1,5 +1,5 @@ error: the range pattern here has ambiguous interpretation - --> $DIR/range-inclusive-pattern-precedence.rs:14:10 + --> $DIR/range-inclusive-pattern-precedence.rs:15:10 | LL | &10..=15 => {} | ^^^^^^^ help: add parentheses to clarify the precedence: `(10 ..=15)` @@ -15,6 +15,8 @@ note: the lint level is defined here | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/range/range-inclusive-pattern-precedence2.rs b/src/test/ui/range/range-inclusive-pattern-precedence2.rs index 6a3fd413e4f..7fa2698a496 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence2.rs +++ b/src/test/ui/range/range-inclusive-pattern-precedence2.rs @@ -9,6 +9,7 @@ fn main() { // FIXME: can we add suggestions like `&(0..=9)`? box 0...9 => {} //~^ WARN `...` range patterns are deprecated + //~| WARN this was previously accepted by the compiler //~| HELP use `..=` for an inclusive range box 10..=15 => {} //~^ ERROR the range pattern here has ambiguous interpretation diff --git a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr index 7fbd972569e..e8e62b485cc 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr +++ b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr @@ -1,5 +1,5 @@ error: the range pattern here has ambiguous interpretation - --> $DIR/range-inclusive-pattern-precedence2.rs:13:13 + --> $DIR/range-inclusive-pattern-precedence2.rs:14:13 | LL | box 10..=15 => {} | ^^^^^^^ help: add parentheses to clarify the precedence: `(10 ..=15)` @@ -15,6 +15,8 @@ note: the lint level is defined here | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/rust-2018/suggestions-not-always-applicable.fixed b/src/test/ui/rust-2018/suggestions-not-always-applicable.fixed index 12348e6e07d..f5afbad9f78 100644 --- a/src/test/ui/rust-2018/suggestions-not-always-applicable.fixed +++ b/src/test/ui/rust-2018/suggestions-not-always-applicable.fixed @@ -14,12 +14,8 @@ pub struct Foo; mod test { use crate::foo::foo; - #[foo] //~ WARN: absolute paths must start with - //~| WARN: previously accepted - //~| WARN: absolute paths - //~| WARN: previously accepted - fn main() { - } + #[foo] + fn main() {} } fn main() { diff --git a/src/test/ui/rust-2018/suggestions-not-always-applicable.rs b/src/test/ui/rust-2018/suggestions-not-always-applicable.rs index 12348e6e07d..f5afbad9f78 100644 --- a/src/test/ui/rust-2018/suggestions-not-always-applicable.rs +++ b/src/test/ui/rust-2018/suggestions-not-always-applicable.rs @@ -14,12 +14,8 @@ pub struct Foo; mod test { use crate::foo::foo; - #[foo] //~ WARN: absolute paths must start with - //~| WARN: previously accepted - //~| WARN: absolute paths - //~| WARN: previously accepted - fn main() { - } + #[foo] + fn main() {} } fn main() { diff --git a/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr b/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr deleted file mode 100644 index 45502a5b880..00000000000 --- a/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr +++ /dev/null @@ -1,28 +0,0 @@ -warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/suggestions-not-always-applicable.rs:17:5 - | -LL | #[foo] - | ^^^^^^ - | -note: the lint level is defined here - --> $DIR/suggestions-not-always-applicable.rs:8:9 - | -LL | #![warn(rust_2018_compatibility)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - = note: `#[warn(absolute_paths_not_starting_with_crate)]` implied by `#[warn(rust_2018_compatibility)]` - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! - = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130> - = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) - -warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/suggestions-not-always-applicable.rs:17:5 - | -LL | #[foo] - | ^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! - = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130> - = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) - -warning: 2 warnings emitted - diff --git a/src/test/ui/suggestions/issue-61963.rs b/src/test/ui/suggestions/issue-61963.rs index 666fc965f02..b5c379ebc6e 100644 --- a/src/test/ui/suggestions/issue-61963.rs +++ b/src/test/ui/suggestions/issue-61963.rs @@ -11,15 +11,17 @@ extern crate issue_61963_1; // generate code which would trigger the lint. pub struct Baz; -pub trait Bar { } +pub trait Bar {} pub struct Qux<T>(T); #[dom_struct] pub struct Foo { //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects] + //~| WARN this was previously accepted by the compiler qux: Qux<Qux<Baz>>, bar: Box<Bar>, //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects] + //~| WARN this was previously accepted by the compiler } fn main() {} diff --git a/src/test/ui/suggestions/issue-61963.stderr b/src/test/ui/suggestions/issue-61963.stderr index 62ae5fa3fe5..f8c58b61734 100644 --- a/src/test/ui/suggestions/issue-61963.stderr +++ b/src/test/ui/suggestions/issue-61963.stderr @@ -1,5 +1,5 @@ error: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-61963.rs:21:14 + --> $DIR/issue-61963.rs:22:14 | LL | bar: Box<Bar>, | ^^^ help: use `dyn`: `dyn Bar` @@ -9,12 +9,17 @@ note: the lint level is defined here | LL | #![deny(bare_trait_objects)] | ^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-61963.rs:18:1 | LL | pub struct Foo { | ^^^ help: use `dyn`: `dyn pub` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/bound/not-on-bare-trait.rs b/src/test/ui/traits/bound/not-on-bare-trait.rs index 33c9f2f00cf..08355a55630 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.rs +++ b/src/test/ui/traits/bound/not-on-bare-trait.rs @@ -1,5 +1,5 @@ trait Foo { - fn dummy(&self) { } + fn dummy(&self) {} } // This should emit the less confusing error, not the more confusing one. @@ -7,6 +7,7 @@ trait Foo { fn foo(_x: Foo + Send) { //~^ ERROR the size for values of type //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted by the compiler } -fn main() { } +fn main() {} diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr index e7fc0fa5ec0..f087a45a6c4 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -5,6 +5,8 @@ LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ help: use `dyn`: `dyn Foo + Send` | = note: `#[warn(bare_trait_objects)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time --> $DIR/not-on-bare-trait.rs:7:8 |
