diff options
Diffstat (limited to 'src/test/ui/error-codes/E0271.rs')
-rw-r--r-- | src/test/ui/error-codes/E0271.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0271.rs b/src/test/ui/error-codes/E0271.rs new file mode 100644 index 000000000..f27190754 --- /dev/null +++ b/src/test/ui/error-codes/E0271.rs @@ -0,0 +1,11 @@ +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 +} |