From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../dyn-2015-edition-keyword-ident-lint.fixed | 82 ------------- .../dyn-2015-edition-keyword-ident-lint.rs | 82 ------------- .../dyn-2015-edition-keyword-ident-lint.stderr | 133 --------------------- .../dyn-2015-idents-in-decl-macros-unlinted.rs | 52 -------- .../dyn-2015-idents-in-macros-unlinted.rs | 57 --------- .../dyn-2015-no-warnings-without-lints.rs | 28 ----- src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs | 24 ---- .../ui/dyn-keyword/dyn-2018-edition-lint.stderr | 98 --------------- src/test/ui/dyn-keyword/dyn-2021-edition-error.rs | 11 -- .../ui/dyn-keyword/dyn-2021-edition-error.stderr | 25 ---- src/test/ui/dyn-keyword/dyn-angle-brackets.fixed | 21 ---- src/test/ui/dyn-keyword/dyn-angle-brackets.rs | 21 ---- src/test/ui/dyn-keyword/dyn-angle-brackets.stderr | 20 ---- .../issue-56327-dyn-trait-in-macro-is-okay.rs | 27 ----- 14 files changed, 681 deletions(-) delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr delete mode 100644 src/test/ui/dyn-keyword/dyn-2021-edition-error.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr delete mode 100644 src/test/ui/dyn-keyword/dyn-angle-brackets.fixed delete mode 100644 src/test/ui/dyn-keyword/dyn-angle-brackets.rs delete mode 100644 src/test/ui/dyn-keyword/dyn-angle-brackets.stderr delete mode 100644 src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs (limited to 'src/test/ui/dyn-keyword') diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed deleted file mode 100644 index c815080fc..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed +++ /dev/null @@ -1,82 +0,0 @@ -// Under the 2015 edition with the keyword_idents lint, `dyn` is not -// entirely acceptable as an identifier. We currently do not attempt -// to detect or fix uses of `dyn` under a macro. Since we are testing -// this file via `rustfix`, we want the rustfix output to be -// compilable; so the macros here carefully use `dyn` "correctly." -// -// edition:2015 -// run-rustfix - -#![allow(non_camel_case_types)] -#![deny(keyword_idents)] - -mod outer_mod { - pub mod r#dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - pub struct r#dyn; -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - } -} -use outer_mod::r#dyn::r#dyn; -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - -fn main() { - match r#dyn { r#dyn => {} } -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - macro_defn::r#dyn(); -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - - macro_defn::boxed(); -} - -mod macro_defn { - use super::Trait; - - macro_rules! r#dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - - // Note that we do not lint nor fix occurrences under macros - ($dyn:tt) => { (Box, Box<$dyn Trait>) } - } - - pub fn r#dyn() -> ::outer_mod::r#dyn::r#dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - ::outer_mod::r#dyn::r#dyn -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - } - - - - pub fn boxed() -> r#dyn!( - //~^ ERROR `dyn` is a keyword - //~| WARN this is accepted in the current edition - - // Note that we do not lint nor fix occurrences under macros - dyn - ) - { - (Box::new(1), Box::new(2)) - } -} - -pub trait Trait { } - -impl Trait for u32 { } diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs deleted file mode 100644 index 6cdc70714..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Under the 2015 edition with the keyword_idents lint, `dyn` is not -// entirely acceptable as an identifier. We currently do not attempt -// to detect or fix uses of `dyn` under a macro. Since we are testing -// this file via `rustfix`, we want the rustfix output to be -// compilable; so the macros here carefully use `dyn` "correctly." -// -// edition:2015 -// run-rustfix - -#![allow(non_camel_case_types)] -#![deny(keyword_idents)] - -mod outer_mod { - pub mod dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - pub struct dyn; -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - } -} -use outer_mod::dyn::dyn; -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - -fn main() { - match dyn { dyn => {} } -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - macro_defn::dyn(); -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - - macro_defn::boxed(); -} - -mod macro_defn { - use super::Trait; - - macro_rules! dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - - // Note that we do not lint nor fix occurrences under macros - ($dyn:tt) => { (Box, Box<$dyn Trait>) } - } - - pub fn dyn() -> ::outer_mod::dyn::dyn { -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - ::outer_mod::dyn::dyn -//~^ ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition -//~| ERROR `dyn` is a keyword -//~| WARN this is accepted in the current edition - } - - - - pub fn boxed() -> dyn!( - //~^ ERROR `dyn` is a keyword - //~| WARN this is accepted in the current edition - - // Note that we do not lint nor fix occurrences under macros - dyn - ) - { - (Box::new(1), Box::new(2)) - } -} - -pub trait Trait { } - -impl Trait for u32 { } diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr deleted file mode 100644 index 89aded913..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr +++ /dev/null @@ -1,133 +0,0 @@ -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:14:13 - | -LL | pub mod dyn { - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 -note: the lint level is defined here - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:11:9 - | -LL | #![deny(keyword_idents)] - | ^^^^^^^^^^^^^^ - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:17:20 - | -LL | pub struct dyn; - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:22:16 - | -LL | use outer_mod::dyn::dyn; - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:22:21 - | -LL | use outer_mod::dyn::dyn; - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:29:11 - | -LL | match dyn { dyn => {} } - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:29:17 - | -LL | match dyn { dyn => {} } - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:34:17 - | -LL | macro_defn::dyn(); - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:44:18 - | -LL | macro_rules! dyn { - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:12 - | -LL | pub fn dyn() -> ::outer_mod::dyn::dyn { - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:34 - | -LL | pub fn dyn() -> ::outer_mod::dyn::dyn { - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:39 - | -LL | pub fn dyn() -> ::outer_mod::dyn::dyn { - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:59:22 - | -LL | ::outer_mod::dyn::dyn - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:59:27 - | -LL | ::outer_mod::dyn::dyn - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-2015-edition-keyword-ident-lint.rs:68:23 - | -LL | pub fn boxed() -> dyn!( - | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see issue #49716 - -error: aborting due to 14 previous errors - diff --git a/src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs b/src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs deleted file mode 100644 index bda2ed17e..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Under the 2015 edition with the keyword_idents lint, `dyn` is -// not entirely acceptable as an identifier. -// -// We currently do not attempt to detect or fix uses of `dyn` as an -// identifier under a macro, including under the declarative `macro` -// forms from macros 1.2 and macros 2.0. -// -// check-pass -// edition:2015 - -#![feature(decl_macro)] -#![allow(non_camel_case_types)] -#![deny(keyword_idents)] - -mod outer_mod { - pub mod r#dyn { - pub struct r#dyn; - } -} - -// Here we are illustrating that the current lint does not flag the -// occurrences of `dyn` in this macro definition; however, it -// certainly *could* (and it would be nice if it did), since these -// occurrences are not compatible with the 2018 edition's -// interpretation of `dyn` as a keyword. -macro defn_has_dyn_idents() { ::outer_mod::dyn::dyn } - -struct X; -trait Trait { fn hello(&self) { }} -impl Trait for X { } - -macro tt_trait($arg:tt) { & $arg Trait } -macro id_trait($id:ident) { & $id Trait } - -fn main() { - defn_has_dyn_idents!(); - - // Here we are illustrating that the current lint does not flag - // the occurrences of `dyn` in these macro invocations. It - // definitely should *not* flag the one in `tt_trait`, since that - // is expanding in a valid fashion to `&dyn Trait`. - // - // It is arguable whether it would be valid to flag the occurrence - // in `id_trait`, since that macro specifies that it takes an - // `ident` as its input. - fn f_tt(x: &X) -> tt_trait!(dyn) { x } - fn f_id(x: &X) -> id_trait!(dyn) { x } - - let x = X; - f_tt(&x).hello(); - f_id(&x).hello(); -} diff --git a/src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs b/src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs deleted file mode 100644 index 472f6b5c8..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Under the 2015 edition with the keyword_idents lint, `dyn` is -// not entirely acceptable as an identifier. -// -// We currently do not attempt to detect or fix uses of `dyn` as an -// identifier under a macro. -// -// check-pass -// edition:2015 - -#![allow(non_camel_case_types)] -#![deny(keyword_idents)] - -mod outer_mod { - pub mod r#dyn { - pub struct r#dyn; - } -} - -// Here we are illustrating that the current lint does not flag the -// occurrences of `dyn` in this macro definition; however, it -// certainly *could* (and it would be nice if it did), since these -// occurrences are not compatible with the 2018 edition's -// interpretation of `dyn` as a keyword. -macro_rules! defn_has_dyn_idents { - () => { ::outer_mod::dyn::dyn } -} - -struct X; -trait Trait { fn hello(&self) { }} -impl Trait for X { } - -macro_rules! tt_trait { - ($arg:tt) => { & $arg Trait } -} - -macro_rules! id_trait { - ($id:ident) => { & $id Trait } -} - -fn main() { - defn_has_dyn_idents!(); - - // Here we are illustrating that the current lint does not flag - // the occurrences of `dyn` in these macro invocations. It - // definitely should *not* flag the one in `tt_trait`, since that - // is expanding in a valid fashion to `&dyn Trait`. - // - // It is arguable whether it would be valid to flag the occurrence - // in `id_trait`, since that macro specifies that it takes an - // `ident` as its input. - fn f_tt(x: &X) -> tt_trait!(dyn) { x } - fn f_id(x: &X) -> id_trait!(dyn) { x } - - let x = X; - f_tt(&x).hello(); - f_id(&x).hello(); -} diff --git a/src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs b/src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs deleted file mode 100644 index d6a33c08d..000000000 --- a/src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Under the 2015 edition without the keyword_idents lint, `dyn` is -// entirely acceptable as an identifier. -// -// check-pass -// edition:2015 - -#![allow(non_camel_case_types)] - -mod outer_mod { - pub mod dyn { - pub struct dyn; - } -} -use outer_mod::dyn::dyn; - -fn main() { - match dyn { dyn => {} } - macro_defn::dyn(); -} -mod macro_defn { - macro_rules! dyn { - () => { ::outer_mod::dyn::dyn } - } - - pub fn dyn() -> ::outer_mod::dyn::dyn { - dyn!() - } -} diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs deleted file mode 100644 index a074b5fa5..000000000 --- a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs +++ /dev/null @@ -1,24 +0,0 @@ -// edition:2018 -#[deny(bare_trait_objects)] - -fn function(x: &SomeTrait, y: Box) { - //~^ ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - //~| ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - //~| ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - //~| ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - //~| ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - //~| ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition - let _x: &SomeTrait = todo!(); - //~^ ERROR trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition -} - -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 deleted file mode 100644 index 6bafff919..000000000 --- a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr +++ /dev/null @@ -1,98 +0,0 @@ -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:17 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -note: the lint level is defined here - --> $DIR/dyn-2018-edition-lint.rs:2:8 - | -LL | #[deny(bare_trait_objects)] - | ^^^^^^^^^^^^^^^^^^ -help: use `dyn` - | -LL | fn function(x: &dyn SomeTrait, y: Box) { - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:35 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | fn function(x: &SomeTrait, y: Box) { - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:17:14 - | -LL | let _x: &SomeTrait = todo!(); - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | let _x: &dyn SomeTrait = todo!(); - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:17 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | fn function(x: &dyn SomeTrait, y: Box) { - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:17 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | fn function(x: &dyn SomeTrait, y: Box) { - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:35 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | fn function(x: &SomeTrait, y: Box) { - | +++ - -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-2018-edition-lint.rs:4:35 - | -LL | fn function(x: &SomeTrait, y: Box) { - | ^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -help: use `dyn` - | -LL | fn function(x: &SomeTrait, y: Box) { - | +++ - -error: aborting due to 7 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 deleted file mode 100644 index 0f05d8753..000000000 --- a/src/test/ui/dyn-keyword/dyn-2021-edition-error.rs +++ /dev/null @@ -1,11 +0,0 @@ -// 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!(); -} - -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 deleted file mode 100644 index 08ee77116..000000000 --- a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr +++ /dev/null @@ -1,25 +0,0 @@ -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 2 previous errors - -For more information about this error, try `rustc --explain E0782`. diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed b/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed deleted file mode 100644 index 00069a3e7..000000000 --- a/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed +++ /dev/null @@ -1,21 +0,0 @@ -// See https://github.com/rust-lang/rust/issues/88508 -// run-rustfix -// edition:2018 -#![deny(bare_trait_objects)] -#![allow(dead_code)] -#![allow(unused_imports)] - -use std::fmt; - -#[derive(Debug)] -pub struct Foo; - -impl fmt::Display for Foo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - //~^ ERROR trait objects without an explicit `dyn` are deprecated - //~| WARNING this is accepted in the current edition - } -} - -fn main() {} diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.rs b/src/test/ui/dyn-keyword/dyn-angle-brackets.rs deleted file mode 100644 index ee5fee4cf..000000000 --- a/src/test/ui/dyn-keyword/dyn-angle-brackets.rs +++ /dev/null @@ -1,21 +0,0 @@ -// See https://github.com/rust-lang/rust/issues/88508 -// run-rustfix -// edition:2018 -#![deny(bare_trait_objects)] -#![allow(dead_code)] -#![allow(unused_imports)] - -use std::fmt; - -#[derive(Debug)] -pub struct Foo; - -impl fmt::Display for Foo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - //~^ ERROR trait objects without an explicit `dyn` are deprecated - //~| WARNING this is accepted in the current edition - } -} - -fn main() {} diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr b/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr deleted file mode 100644 index 0bb764d71..000000000 --- a/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: trait objects without an explicit `dyn` are deprecated - --> $DIR/dyn-angle-brackets.rs:15:10 - | -LL | ::fmt(self, f) - | ^^^^^^^^^^ - | - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see -note: the lint level is defined here - --> $DIR/dyn-angle-brackets.rs:4:9 - | -LL | #![deny(bare_trait_objects)] - | ^^^^^^^^^^^^^^^^^^ -help: use `dyn` - | -LL | ::fmt(self, f) - | +++ - -error: aborting due to previous error - diff --git a/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs b/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs deleted file mode 100644 index 59e7f9a60..000000000 --- a/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs +++ /dev/null @@ -1,27 +0,0 @@ -// check-pass -// edition:2015 -// -// rust-lang/rust#56327: Some occurrences of `dyn` within a macro are -// not instances of identifiers, and thus should *not* be caught by the -// keyword_ident lint. -// -// Otherwise, rustfix replaces the type `Box` with -// `Box`, which is injecting a bug rather than fixing -// anything. - -#![deny(rust_2018_compatibility)] -#![allow(dyn_drop)] - -macro_rules! foo { - () => { - fn generated_foo() { - let _x: Box; - } - } -} - -foo!(); - -fn main() { - generated_foo(); -} -- cgit v1.2.3