diff options
Diffstat (limited to 'src/test/ui/wf/wf-impl-associated-type-trait.rs')
-rw-r--r-- | src/test/ui/wf/wf-impl-associated-type-trait.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.rs b/src/test/ui/wf/wf-impl-associated-type-trait.rs new file mode 100644 index 000000000..84e628e21 --- /dev/null +++ b/src/test/ui/wf/wf-impl-associated-type-trait.rs @@ -0,0 +1,22 @@ +// Check that we require that associated types in an impl are well-formed. + + +#![allow(dead_code)] + +pub trait MyHash { } + +pub struct MySet<T:MyHash> { + data: Vec<T> +} + +pub trait Foo { + type Bar; +} + +impl<T> Foo for T { + type Bar = MySet<T>; + //~^ ERROR the trait bound `T: MyHash` is not satisfied +} + + +fn main() { } |