blob: bb316eed34de7a40c0489fe4b77ea9f56d84617a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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() {}
|