diff options
Diffstat (limited to 'src/test/ui/generic-associated-types/issue-74816.rs')
-rw-r--r-- | src/test/ui/generic-associated-types/issue-74816.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/issue-74816.rs b/src/test/ui/generic-associated-types/issue-74816.rs new file mode 100644 index 000000000..c932025d1 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-74816.rs @@ -0,0 +1,22 @@ +#![feature(associated_type_defaults)] +#![feature(generic_associated_types)] + +trait Trait1 { + fn foo(); +} + +trait Trait2 { + type Associated: Trait1 = Self; + //~^ ERROR: the trait bound `Self: Trait1` is not satisfied + //~| the size for values of type `Self` cannot be known +} + +impl Trait2 for () {} + +fn call_foo<T: Trait2>() { + T::Associated::foo() +} + +fn main() { + call_foo::<()>() +} |