]> git.lizzy.rs Git - rust.git/commitdiff
Bless tests.
authorCamille GILLOT <gillot.camille@gmail.com>
Sat, 20 Nov 2021 10:54:12 +0000 (11:54 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Sat, 4 Dec 2021 22:13:58 +0000 (23:13 +0100)
src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs
src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
src/test/ui/suggestions/issue-61963.rs
src/test/ui/suggestions/issue-61963.stderr

index d8b3b9c7deba5188e1473aba064fefbdae81e71f..a074b5fa5f7aa88b442c24e53fe855c20af48c17 100644 (file)
@@ -6,7 +6,17 @@ fn function(x: &SomeTrait, y: Box<SomeTrait>) {
     //~| 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 {}
index 7e9435efb08d2698c1569d14d4197f16398c7b57..b8e4942dfefb241fce474c30e22fd582a3c86615 100644 (file)
@@ -31,5 +31,75 @@ LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
 LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
    | 
 
-error: aborting due to 2 previous errors
+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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL -     let _x: &SomeTrait = todo!();
+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<SomeTrait>) {
+   |                 ^^^^^^^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/dyn-2018-edition-lint.rs:4:17
+   |
+LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+   |                 ^^^^^^^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/dyn-2018-edition-lint.rs:4:35
+   |
+LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+   |                                   ^^^^^^^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/dyn-2018-edition-lint.rs:4:35
+   |
+LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+   |                                   ^^^^^^^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
+LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+   | 
+
+error: aborting due to 7 previous errors
 
index d31ed01b1916be31cb3d3fbaedd596581472277e..a27c38452539cd408601ee8ff43d97625bc0157e 100644 (file)
@@ -18,10 +18,20 @@ pub trait Bar {}
 pub struct Foo {
     //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
     //~| WARN this is accepted in the current edition
+    //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition
+    //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition
+    //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition
     qux: Qux<Qux<Baz>>,
     bar: Box<Bar>,
     //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
     //~| WARN this is accepted in the current edition
+    //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition
+    //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition
 }
 
 fn main() {}
index 7dfd8c327085752931f05dc0f56cc445479bedae..1eebd8d60ca90b43fe812e450e8e80a09df5aeb2 100644 (file)
@@ -1,5 +1,5 @@
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:22:14
+  --> $DIR/issue-61963.rs:28:14
    |
 LL |     bar: Box<Bar>,
    |              ^^^
@@ -31,5 +31,75 @@ LL - pub struct Foo {
 LL + dyn pub struct Foo {
    | 
 
-error: aborting due to 2 previous errors
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:28:14
+   |
+LL |     bar: Box<Bar>,
+   |              ^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL -     bar: Box<Bar>,
+LL +     bar: Box<dyn Bar>,
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:28:14
+   |
+LL |     bar: Box<Bar>,
+   |              ^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL -     bar: Box<Bar>,
+LL +     bar: Box<dyn Bar>,
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:18:1
+   |
+LL | pub struct Foo {
+   | ^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - pub struct Foo {
+LL + dyn pub struct Foo {
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:18:1
+   |
+LL | pub struct Foo {
+   | ^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - pub struct Foo {
+LL + dyn pub struct Foo {
+   | 
+
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:18:1
+   |
+LL | pub struct Foo {
+   | ^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL - pub struct Foo {
+LL + dyn pub struct Foo {
+   | 
+
+error: aborting due to 7 previous errors