mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
12 lines
222 B
Rust
12 lines
222 B
Rust
trait Trait { type AssociatedType; }
|
|
|
|
fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
|
|
println!("in foo");
|
|
}
|
|
|
|
impl Trait for i8 { type AssociatedType = &'static str; }
|
|
|
|
fn main() {
|
|
foo(3_i8); //~ ERROR E0271
|
|
}
|