diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-21974.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-21974.rs b/src/test/ui/issues/issue-21974.rs new file mode 100644 index 000000000..f7c659be1 --- /dev/null +++ b/src/test/ui/issues/issue-21974.rs @@ -0,0 +1,18 @@ +// Test that (for now) we report an ambiguity error here, because +// specific trait relationships are ignored for the purposes of trait +// matching. This behavior should likely be improved such that this +// test passes. See #21974 for more details. + +trait Foo { + fn foo(self); +} + +fn foo<'a,'b,T>(x: &'a T, y: &'b T) + where &'a T : Foo, //~ ERROR type annotations needed + &'b T : Foo +{ + x.foo(); + y.foo(); +} + +fn main() { } |