]> git.lizzy.rs Git - rust.git/blob - tests/ui/wf/wf-impl-associated-type-trait.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / ui / wf / wf-impl-associated-type-trait.rs
1 // Check that we require that associated types in an impl are well-formed.
2
3
4 #![allow(dead_code)]
5
6 pub trait MyHash { }
7
8 pub struct MySet<T:MyHash> {
9     data: Vec<T>
10 }
11
12 pub trait Foo {
13     type Bar;
14 }
15
16 impl<T> Foo for T {
17     type Bar = MySet<T>;
18     //~^ ERROR the trait bound `T: MyHash` is not satisfied
19 }
20
21
22 fn main() { }