diff options
Diffstat (limited to 'tests')
4 files changed, 28 insertions, 1 deletions
diff --git a/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs b/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs new file mode 100644 index 00000000000..5b10aab4b3f --- /dev/null +++ b/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs @@ -0,0 +1,5 @@ +pub trait Foo { + type Gat<T> + where + T: std::fmt::Display; +} diff --git a/tests/ui/generic-associated-types/missing-item-sugg.rs b/tests/ui/generic-associated-types/missing-item-sugg.rs new file mode 100644 index 00000000000..35d573d8188 --- /dev/null +++ b/tests/ui/generic-associated-types/missing-item-sugg.rs @@ -0,0 +1,11 @@ +// aux-build:missing-item-sugg.rs + +extern crate missing_item_sugg; + +struct Local; +impl missing_item_sugg::Foo for Local { + //~^ ERROR not all trait items implemented, missing: `Gat` +} +//~^ HELP implement the missing item: `type Gat<T> = /* Type */ where T: std::fmt::Display;` + +fn main() {} diff --git a/tests/ui/generic-associated-types/missing-item-sugg.stderr b/tests/ui/generic-associated-types/missing-item-sugg.stderr new file mode 100644 index 00000000000..378115f6d38 --- /dev/null +++ b/tests/ui/generic-associated-types/missing-item-sugg.stderr @@ -0,0 +1,11 @@ +error[E0046]: not all trait items implemented, missing: `Gat` + --> $DIR/missing-item-sugg.rs:6:1 + | +LL | impl missing_item_sugg::Foo for Local { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Gat` in implementation + | + = help: implement the missing item: `type Gat<T> = /* Type */ where T: std::fmt::Display;` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr index 657a5c546d3..4c2d2776d3d 100644 --- a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr +++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr @@ -1,7 +1,7 @@ error[E0046]: not all trait items implemented, missing: `Type`, `bar`, `baz`, `A` --> $DIR/missing-assoc-fn-applicable-suggestions.rs:7:1 | -LL | impl TraitA<()> for S { +LL | impl TraitA<()> for S { | ^^^^^^^^^^^^^^^^^^^^^ missing `Type`, `bar`, `baz`, `A` in implementation | = help: implement the missing item: `type Type = /* Type */;` |
