diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index e7c566e586cbd..32320130b677c 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -46,7 +46,7 @@ use rustc_ast_pretty::pprust; use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sync::Lrc; -use rustc_errors::struct_span_err; +use rustc_errors::{struct_span_err, Applicability}; use rustc_hir as hir; use rustc_hir::def::{DefKind, Namespace, PartialRes, PerNS, Res}; use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, CRATE_DEF_ID}; @@ -58,6 +58,7 @@ use rustc_session::lint::builtin::{BARE_TRAIT_OBJECTS, MISSING_ABI}; use rustc_session::lint::{BuiltinLintDiagnostics, LintBuffer}; use rustc_session::utils::{FlattenNonterminals, NtToTokenstream}; use rustc_session::Session; +use rustc_span::edition::Edition; use rustc_span::hygiene::ExpnId; use rustc_span::source_map::{respan, DesugaringKind}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; @@ -2730,13 +2731,26 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { .map(|snippet| snippet.starts_with("#[")) .unwrap_or(true); if !is_macro_callsite { - self.resolver.lint_buffer().buffer_lint_with_diagnostic( - BARE_TRAIT_OBJECTS, - id, - span, - "trait objects without an explicit `dyn` are deprecated", - BuiltinLintDiagnostics::BareTraitObject(span, is_global), - ) + if span.edition() < Edition::Edition2021 { + self.resolver.lint_buffer().buffer_lint_with_diagnostic( + BARE_TRAIT_OBJECTS, + id, + span, + "trait objects without an explicit `dyn` are deprecated", + BuiltinLintDiagnostics::BareTraitObject(span, is_global), + ) + } else { + let msg = "trait objects must include the `dyn` keyword"; + let label = "add `dyn` keyword before this trait"; + let mut err = struct_span_err!(self.sess, span, E0782, "{}", msg,); + err.span_suggestion_verbose( + span.shrink_to_lo(), + label, + String::from("dyn "), + Applicability::MachineApplicable, + ); + err.emit(); + } } } diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index 41a1fa488d31b..c343809179b0a 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -470,6 +470,8 @@ E0778: include_str!("./error_codes/E0778.md"), E0779: include_str!("./error_codes/E0779.md"), E0780: include_str!("./error_codes/E0780.md"), E0781: include_str!("./error_codes/E0781.md"), +E0782: include_str!("./error_codes/E0782.md"), +E0783: include_str!("./error_codes/E0783.md"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard diff --git a/compiler/rustc_error_codes/src/error_codes/E0782.md b/compiler/rustc_error_codes/src/error_codes/E0782.md new file mode 100644 index 0000000000000..0f3253c050e2b --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0782.md @@ -0,0 +1,26 @@ +Trait objects must include the `dyn` keyword. + +Erroneous code example: + +```edition2021,compile_fail,E0782 +trait Foo {} +fn test(arg: Box) {} // error! +``` + +Trait objects are a way to call methods on types that are not known until +runtime but conform to some trait. + +Trait objects should be formed with `Box`, but in the code above +`dyn` is left off. + +This makes it harder to see that `arg` is a trait object and not a +simply a heap allocated type called `Foo`. + +To fix this issue, add `dyn` before the trait name. + +```edition2021 +trait Foo {} +fn test(arg: Box) {} // ok! +``` + +This used to be allowed before edition 2021, but is now an error. diff --git a/compiler/rustc_error_codes/src/error_codes/E0783.md b/compiler/rustc_error_codes/src/error_codes/E0783.md new file mode 100644 index 0000000000000..73981e59e0d95 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0783.md @@ -0,0 +1,22 @@ +The range pattern `...` is no longer allowed. + +Erroneous code example: + +```edition2021,compile_fail,E0783 +match 2u8 { + 0...9 => println!("Got a number less than 10"), // error! + _ => println!("Got a number 10 or more"), +} +``` + +Older Rust code using previous editions allowed `...` to stand for exclusive +ranges which are now signified using `..=`. + +To make this code compile replace the `...` with `..=`. + +```edition2021 +match 2u8 { + 0..=9 => println!("Got a number less than 10"), // ok! + _ => println!("Got a number 10 or more"), +} +``` diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index c9b038f0e8796..e7275374b8915 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1660,7 +1660,11 @@ declare_lint! { /// [`..` range expression]: https://doc.rust-lang.org/reference/expressions/range-expr.html pub ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, Warn, - "`...` range patterns are deprecated" + "`...` range patterns are deprecated", + @future_incompatible = FutureIncompatibleInfo { + reference: "issue #80165 ", + edition: Some(Edition::Edition2021), + }; } #[derive(Default)] @@ -1704,32 +1708,57 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns { let suggestion = "use `..=` for an inclusive range"; if parenthesise { self.node_id = Some(pat.id); - cx.struct_span_lint(ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, pat.span, |lint| { - let end = expr_to_string(&end); - let replace = match start { - Some(start) => format!("&({}..={})", expr_to_string(&start), end), - None => format!("&(..={})", end), - }; - lint.build(msg) - .span_suggestion( - pat.span, - suggestion, - replace, - Applicability::MachineApplicable, - ) - .emit(); - }); + let end = expr_to_string(&end); + let replace = match start { + Some(start) => format!("&({}..={})", expr_to_string(&start), end), + None => format!("&(..={})", end), + }; + if join.edition() >= Edition::Edition2021 { + let mut err = + rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,); + err.span_suggestion( + pat.span, + suggestion, + replace, + Applicability::MachineApplicable, + ) + .emit(); + } else { + cx.struct_span_lint(ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, pat.span, |lint| { + lint.build(msg) + .span_suggestion( + pat.span, + suggestion, + replace, + Applicability::MachineApplicable, + ) + .emit(); + }); + } } else { - cx.struct_span_lint(ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, join, |lint| { - lint.build(msg) - .span_suggestion_short( - join, - suggestion, - "..=".to_owned(), - Applicability::MachineApplicable, - ) - .emit(); - }); + let replace = "..=".to_owned(); + if join.edition() >= Edition::Edition2021 { + let mut err = + rustc_errors::struct_span_err!(cx.sess, pat.span, E0783, "{}", msg,); + err.span_suggestion_short( + join, + suggestion, + replace, + Applicability::MachineApplicable, + ) + .emit(); + } else { + cx.struct_span_lint(ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, join, |lint| { + lint.build(msg) + .span_suggestion_short( + join, + suggestion, + replace, + Applicability::MachineApplicable, + ) + .emit(); + }); + } }; } } diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 04e45e2351b56..beb4d36597cfc 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1618,7 +1618,11 @@ declare_lint! { /// [`impl Trait`]: https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters pub BARE_TRAIT_OBJECTS, Warn, - "suggest using `dyn Trait` for trait objects" + "suggest using `dyn Trait` for trait objects", + @future_incompatible = FutureIncompatibleInfo { + reference: "issue #80165 ", + edition: Some(Edition::Edition2021), + }; } declare_lint! { diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index 26e61ec8cf866..7adaf54fa2374 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -272,11 +272,13 @@ pub fn struct_lint_level<'s, 'd>( // emit shouldn't be automatically fixed by rustfix. err.allow_suggestions(false); - // If this is a future incompatible lint it'll become a hard error, so - // we have to emit *something*. Also, if this lint occurs in the - // expansion of a macro from an external crate, allow individual lints - // to opt-out from being reported. - if future_incompatible.is_none() && !lint.report_in_external_macro { + // If this is a future incompatible that is not an edition fixing lint + // it'll become a hard error, so we have to emit *something*. Also, + // if this lint occurs in the expansion of a macro from an external crate, + // allow individual lints to opt-out from being reported. + let not_future_incompatible = + future_incompatible.map(|f| f.edition.is_some()).unwrap_or(true); + if not_future_incompatible && !lint.report_in_external_macro { err.cancel(); // Don't continue further, since we don't want to have // `diag_span_note_once` called for a diagnostic that isn't emitted. diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs index 1959fe75e8e9a..0c6a33b91cea5 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs @@ -30,6 +30,7 @@ use rustc_middle::ty::{ use rustc_session::lint; use rustc_session::lint::builtin::BARE_TRAIT_OBJECTS; use rustc_session::parse::feature_err; +use rustc_span::edition::Edition; use rustc_span::source_map::{original_sp, DUMMY_SP}; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::{self, BytePos, MultiSpan, Span}; @@ -969,20 +970,42 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let TyKind::TraitObject([poly_trait_ref, ..], _, TraitObjectSyntax::None) = self_ty.kind { - self.tcx.struct_span_lint_hir(BARE_TRAIT_OBJECTS, hir_id, self_ty.span, |lint| { - let mut db = lint - .build(&format!("trait objects without an explicit `dyn` are deprecated")); - let (sugg, app) = match self.tcx.sess.source_map().span_to_snippet(self_ty.span) - { - Ok(s) if poly_trait_ref.trait_ref.path.is_global() => { - (format!("", s), Applicability::MachineApplicable) - } - Ok(s) => (format!("", s), Applicability::MachineApplicable), - Err(_) => (">".to_string(), Applicability::HasPlaceholders), - }; - db.span_suggestion(self_ty.span, "use `dyn`", sugg, app); - db.emit() - }); + let msg = "trait objects without an explicit `dyn` are deprecated"; + let (sugg, app) = match self.tcx.sess.source_map().span_to_snippet(self_ty.span) { + Ok(s) if poly_trait_ref.trait_ref.path.is_global() => { + (format!("", s), Applicability::MachineApplicable) + } + Ok(s) => (format!("", s), Applicability::MachineApplicable), + Err(_) => (">".to_string(), Applicability::HasPlaceholders), + }; + let replace = String::from("use `dyn`"); + if self.sess().edition() >= Edition::Edition2021 { + let mut err = rustc_errors::struct_span_err!( + self.sess(), + self_ty.span, + E0783, + "{}", + msg, + ); + err.span_suggestion( + self_ty.span, + &sugg, + replace, + Applicability::MachineApplicable, + ) + .emit(); + } else { + self.tcx.struct_span_lint_hir( + BARE_TRAIT_OBJECTS, + hir_id, + self_ty.span, + |lint| { + let mut db = lint.build(msg); + db.span_suggestion(self_ty.span, &replace, sugg, app); + db.emit() + }, + ); + } } } } diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 965d11621450b..de9c1882c7d48 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1709,6 +1709,9 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> builder.info(&format!("doc tests for: {}", markdown.display())); let mut cmd = builder.rustdoc_cmd(compiler); builder.add_rust_test_threads(&mut cmd); + // allow for unstable options such as new editions + cmd.arg("-Z"); + cmd.arg("unstable-options"); cmd.arg("--test"); cmd.arg(markdown); cmd.env("RUSTC_BOOTSTRAP", "1"); 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 f8b9d7adbfef3..d845e00694a2d 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 ad451fcf65df7..857498a1111f5 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::(); | ^ 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::(); | ^ 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::()>(); | ^ expected one of `,` or `>` @@ -65,7 +65,7 @@ LL | foo::<{ bar() }>(); | ^ ^ 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::()>(); | ^ expected one of `,` or `>` @@ -76,7 +76,7 @@ LL | foo::<{ bar::() }>(); | ^ ^ 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>(); | ^ expected one of `,` or `>` @@ -87,7 +87,7 @@ LL | foo::<{ bar::() + 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>(); | ^ expected one of `,` or `>` @@ -98,7 +98,7 @@ LL | foo::<{ bar::() - 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::()>(); | ^ expected one of `,` or `>` @@ -109,7 +109,7 @@ LL | foo::<{ BAR - bar::() }>(); | ^ ^ 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::()>(); | ^ expected one of `,` or `>` @@ -138,6 +138,8 @@ LL | foo::(); | ^^^^^^^^^ 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 error[E0747]: type provided when a constant was expected --> $DIR/const-expression-suggest-missing-braces.rs:11:11 diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs new file mode 100644 index 0000000000000..7c2babaf7abaa --- /dev/null +++ b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs @@ -0,0 +1,16 @@ +// edition:2018 +#[deny(bare_trait_objects)] + +fn function(x: &SomeTrait, y: Box) { + //~^ ERROR trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted + //~| ERROR trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted + let _x: &SomeTrait = todo!(); + //~^ ERROR trait objects without an explicit `dyn` are deprecated + //~| WARN this was previously accepted +} + +trait SomeTrait {} + +fn main() {} diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr new file mode 100644 index 0000000000000..ea73e56d8433d --- /dev/null +++ b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr @@ -0,0 +1,34 @@ +error: trait objects without an explicit `dyn` are deprecated + --> $DIR/dyn-2018-edition-lint.rs:4:17 + | +LL | fn function(x: &SomeTrait, y: Box) { + | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` + | +note: the lint level is defined here + --> $DIR/dyn-2018-edition-lint.rs:2:8 + | +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 + +error: trait objects without an explicit `dyn` are deprecated + --> $DIR/dyn-2018-edition-lint.rs:4:35 + | +LL | fn function(x: &SomeTrait, y: Box) { + | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` + | + = 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 + +error: trait objects without an explicit `dyn` are deprecated + --> $DIR/dyn-2018-edition-lint.rs:9:14 + | +LL | let _x: &SomeTrait = todo!(); + | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` + | + = 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 + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/dyn-keyword/dyn-2021-edition-error.rs b/src/test/ui/dyn-keyword/dyn-2021-edition-error.rs new file mode 100644 index 0000000000000..bc1bed8a9a4c6 --- /dev/null +++ b/src/test/ui/dyn-keyword/dyn-2021-edition-error.rs @@ -0,0 +1,12 @@ +// edition:2021 + +fn function(x: &SomeTrait, y: Box) { + //~^ ERROR trait objects must include the `dyn` keyword + //~| ERROR trait objects must include the `dyn` keyword + let _x: &SomeTrait = todo!(); + //~^ ERROR trait objects must include the `dyn` keyword +} + +trait SomeTrait {} + +fn main() {} diff --git a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr new file mode 100644 index 0000000000000..798f48060e7b7 --- /dev/null +++ b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr @@ -0,0 +1,36 @@ +error[E0782]: trait objects must include the `dyn` keyword + --> $DIR/dyn-2021-edition-error.rs:6:14 + | +LL | let _x: &SomeTrait = todo!(); + | ^^^^^^^^^ + | +help: add `dyn` keyword before this trait + | +LL | let _x: &dyn SomeTrait = todo!(); + | ^^^ + +error[E0782]: trait objects must include the `dyn` keyword + --> $DIR/dyn-2021-edition-error.rs:3:17 + | +LL | fn function(x: &SomeTrait, y: Box) { + | ^^^^^^^^^ + | +help: add `dyn` keyword before this trait + | +LL | fn function(x: &dyn SomeTrait, y: Box) { + | ^^^ + +error[E0782]: trait objects must include the `dyn` keyword + --> $DIR/dyn-2021-edition-error.rs:3:35 + | +LL | fn function(x: &SomeTrait, y: Box) { + | ^^^^^^^^^ + | +help: add `dyn` keyword before this trait + | +LL | fn function(x: &SomeTrait, y: Box) { + | ^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0782`. 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 bb1f27a17ca4c..40ed42c9ce017 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>) {} //~^ 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 20cb6d8828755..0e95c54d8114f 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>) {} | ^^ 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 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 4c961e998df64..74f838e9ed18d 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 0a2dc5858285a..55c9ea234de29 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: `::Ty` @@ -11,18 +11,26 @@ LL | Dyn::func(); | ^^^ help: use `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 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`: `` + | + = 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 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`: `` + | + = 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 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 d6e5033a0c4c2..a1b738e33fa9b 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 773eea14fd790..d3ebbf38e1cba 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 19fe9ed892acb..ba4ae208e39cb 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 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 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 ae02246046880..88527cc8783c8 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 e51c2c0e8428b..37f38365b016f 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 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 0b10a5f6f4e41..0733b2d2df781 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 abb64f7e490df..9b05383dd7de0 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 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 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 170ac22780b63..0428ea0e2c1b1 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 b12eedf3581b5..8ae5611d89d19 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 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 7412b624b09cd..a10add6d9e523 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 e351a9783bf17..45f6b111e259c 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 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 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 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 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 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 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 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 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 = 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 9fbc938c4dce8..7d55da7d09721 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 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 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 6efbfad8f3865..79b6892dc079a 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 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 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 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 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 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 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 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 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 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 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 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 diff --git a/src/test/ui/range/exclusive-range-patterns-2021.rs b/src/test/ui/range/exclusive-range-patterns-2021.rs new file mode 100644 index 0000000000000..de69c9bf2f384 --- /dev/null +++ b/src/test/ui/range/exclusive-range-patterns-2021.rs @@ -0,0 +1,14 @@ +// edition:2021 + +fn main() { + let n = 2; + match n { + 0...3 => {} + //~^ ERROR `...` range patterns are deprecated + 4...10 => {} + //~^ ERROR `...` range patterns are deprecated + (11...100) => {} + //~^ ERROR `...` range patterns are deprecated + _ => {} + } +} diff --git a/src/test/ui/range/exclusive-range-patterns-2021.stderr b/src/test/ui/range/exclusive-range-patterns-2021.stderr new file mode 100644 index 0000000000000..a967437041a54 --- /dev/null +++ b/src/test/ui/range/exclusive-range-patterns-2021.stderr @@ -0,0 +1,27 @@ +error[E0783]: `...` range patterns are deprecated + --> $DIR/exclusive-range-patterns-2021.rs:6:9 + | +LL | 0...3 => {} + | ^---^ + | | + | help: use `..=` for an inclusive range + +error[E0783]: `...` range patterns are deprecated + --> $DIR/exclusive-range-patterns-2021.rs:8:9 + | +LL | 4...10 => {} + | ^---^^ + | | + | help: use `..=` for an inclusive range + +error[E0783]: `...` range patterns are deprecated + --> $DIR/exclusive-range-patterns-2021.rs:10:10 + | +LL | (11...100) => {} + | ^^---^^^ + | | + | help: use `..=` for an inclusive range + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0783`. diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.fixed b/src/test/ui/range/range-inclusive-pattern-precedence.fixed index 22ab6c755be2d..6c01209967605 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 f38a7920c94d6..ce763ba267798 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 853141969c20d..ffb833535c2f0 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 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 6a3fd413e4fd7..7fa2698a49603 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 7fbd972569e8d..e8e62b485cc1d 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 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 12348e6e07dbc..f5afbad9f78fe 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 12348e6e07dbc..f5afbad9f78fe 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 45502a5b88081..0000000000000 --- 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 - = 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 - = 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 666fc965f02f5..b5c379ebc6eb9 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); #[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>, bar: Box, //~^ 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 62ae5fa3fe54f..f8c58b6173477 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, | ^^^ 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 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 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 33c9f2f00cfee..08355a55630f6 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 b8ae88ace02dd..418e67d56ea1d 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 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 diff --git a/src/tools/clippy/tests/ui/crashes/ice-3969.stderr b/src/tools/clippy/tests/ui/crashes/ice-3969.stderr index 923db0664a714..fb4589a48ec42 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-3969.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-3969.stderr @@ -5,18 +5,26 @@ LL | for<'a> Dst: Sized, | ^^^^^^ help: use `dyn`: `dyn A + 'a` | = note: `-D bare-trait-objects` implied by `-D warnings` + = 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 error: trait objects without an explicit `dyn` are deprecated --> $DIR/ice-3969.rs:27:16 | LL | let x: Dst = *(Box::new(Dst { x: 1 }) as Box>); | ^ 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 error: trait objects without an explicit `dyn` are deprecated --> $DIR/ice-3969.rs:27:57 | LL | let x: Dst = *(Box::new(Dst { x: 1 }) as Box>); | ^ 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 error: aborting due to 3 previous errors diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs index e8fd19a63812b..9696e35b7963f 100644 --- a/src/tools/lint-docs/src/groups.rs +++ b/src/tools/lint-docs/src/groups.rs @@ -13,6 +13,7 @@ static GROUP_DESCRIPTIONS: &[(&str, &str)] = &[ ("nonstandard-style", "Violation of standard naming conventions"), ("future-incompatible", "Lints that detect code that has future-compatibility problems"), ("rust-2018-compatibility", "Lints used to transition code from the 2015 edition to 2018"), + ("rust-2021-compatibility", "Lints used to transition code from the 2018 edition to 2021"), ]; type LintGroups = BTreeMap>;