summary refs log tree commit diff
path: root/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr')
-rw-r--r--tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr38
1 files changed, 10 insertions, 28 deletions
diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr
index 2e3919db1b7..4ccf65b68bf 100644
--- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr
+++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021.stderr
@@ -1,17 +1,3 @@
-error: associated item referring to unboxed trait object for its own trait
-  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:4:13
-   |
-LL | trait A: Sized {
-   |       - in this trait
-LL |     fn f(a: dyn A) -> dyn A;
-   |             ^^^^^     ^^^^^
-   |
-help: you might have meant to use `Self` to refer to the implementing type
-   |
-LL -     fn f(a: dyn A) -> dyn A;
-LL +     fn f(a: Self) -> Self;
-   |
-
 error[E0038]: the trait `A` is not dyn compatible
   --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:4:13
    |
@@ -26,30 +12,21 @@ LL | trait A: Sized {
    |       -  ^^^^^ ...because it requires `Self: Sized`
    |       |
    |       this trait is not dyn compatible...
-
-error: associated item referring to unboxed trait object for its own trait
-  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:9:13
-   |
-LL | trait B {
-   |       - in this trait
-LL |     fn f(a: dyn B) -> dyn B;
-   |             ^^^^^     ^^^^^
-   |
 help: you might have meant to use `Self` to refer to the implementing type
    |
-LL -     fn f(a: dyn B) -> dyn B;
-LL +     fn f(a: Self) -> Self;
+LL -     fn f(a: dyn A) -> dyn A;
+LL +     fn f(a: Self) -> dyn A;
    |
 
 error[E0038]: the trait `B` is not dyn compatible
-  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:9:13
+  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:8:13
    |
 LL |     fn f(a: dyn B) -> dyn B;
    |             ^^^^^ `B` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:9:8
+  --> $DIR/dyn-incompatible-trait-should-use-self-2021.rs:8:8
    |
 LL | trait B {
    |       - this trait is not dyn compatible...
@@ -63,7 +40,12 @@ help: alternatively, consider constraining `f` so it does not apply to trait obj
    |
 LL |     fn f(a: dyn B) -> dyn B where Self: Sized;
    |                             +++++++++++++++++
+help: you might have meant to use `Self` to refer to the implementing type
+   |
+LL -     fn f(a: dyn B) -> dyn B;
+LL +     fn f(a: Self) -> dyn B;
+   |
 
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0038`.