diff options
Diffstat (limited to 'tests/ui/methods/rigid-alias-bound-is-not-inherent-3.rs')
| -rw-r--r-- | tests/ui/methods/rigid-alias-bound-is-not-inherent-3.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/methods/rigid-alias-bound-is-not-inherent-3.rs b/tests/ui/methods/rigid-alias-bound-is-not-inherent-3.rs new file mode 100644 index 00000000000..bb316eed34d --- /dev/null +++ b/tests/ui/methods/rigid-alias-bound-is-not-inherent-3.rs @@ -0,0 +1,26 @@ +use std::ops::Deref; + +trait Trait1 { + fn call_me(&self) {} +} + +impl<T> Trait1 for T {} + +trait Trait2 { + fn call_me(&self) {} +} + +impl<T> Trait2 for T {} + +pub fn foo<T, U>(x: T) +where + T: Deref<Target = U>, + U: Trait1, +{ + // This should be ambiguous. The fact that there's an inherent where-bound + // candidate for `U` should not impact the candidates for `T` + x.call_me(); + //~^ ERROR multiple applicable items in scope +} + +fn main() {} |
