From 25cb1af7b232c93396b122ed6eb0887a388183f7 Mon Sep 17 00:00:00 2001 From: marmeladema Date: Tue, 20 Apr 2021 23:41:40 +0100 Subject: [PATCH] Add test for issue #78671 --- .../generic-associated-types/issue-78671.rs | 14 ++++++++++++++ .../issue-78671.stderr | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/test/ui/generic-associated-types/issue-78671.rs create mode 100644 src/test/ui/generic-associated-types/issue-78671.stderr diff --git a/src/test/ui/generic-associated-types/issue-78671.rs b/src/test/ui/generic-associated-types/issue-78671.rs new file mode 100644 index 00000000000..1b02aac8bcb --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-78671.rs @@ -0,0 +1,14 @@ +#![allow(incomplete_features)] +#![feature(generic_associated_types)] + +trait CollectionFamily { + type Member; + //~^ ERROR: missing generics for associated type +} +fn floatify() { + Box::new(Family) as &dyn CollectionFamily +} + +struct Family; + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-78671.stderr b/src/test/ui/generic-associated-types/issue-78671.stderr new file mode 100644 index 00000000000..7a9aced5bea --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-78671.stderr @@ -0,0 +1,19 @@ +error[E0107]: missing generics for associated type `CollectionFamily::Member` + --> $DIR/issue-78671.rs:5:10 + | +LL | type Member; + | ^^^^^^ expected 1 type argument + | +note: associated type defined here, with 1 type parameter: `T` + --> $DIR/issue-78671.rs:5:10 + | +LL | type Member; + | ^^^^^^ - +help: use angle brackets to add missing type argument + | +LL | type Member; + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`.