1
Fork 0

Fix tests

This commit is contained in:
Ryan Levick 2021-04-16 11:06:51 +02:00
parent 43f9d0ae7e
commit cd8392dd99
31 changed files with 228 additions and 156 deletions

View file

@ -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

View file

@ -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

View file

@ -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() {}

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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
_ => {}
}
}

View file

@ -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
_ => {}
}
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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;
}
}

View file

@ -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)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:43:13
|
LL | if let 0...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:44: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
|
LL | if let X...Y = 0 {}
LL | if let 0...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:46: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
|
LL | if let X...true = 0 {}
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:50:14
--> $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: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: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: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

View file

@ -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
}

View file

@ -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>

View file

@ -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) => {}
_ => {}
}

View file

@ -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) => {}
_ => {}
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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() {

View file

@ -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() {

View file

@ -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

View file

@ -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() {}

View file

@ -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

View file

@ -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() {}

View file

@ -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