]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-bound-ambiguity.rs
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / associated-types-bound-ambiguity.rs
1 // Make sure that if there are multiple applicable bounds on a projection, we
2 // consider them ambiguous. In this test we are initially trying to solve
3 // `Self::Repr: From<_>`, which is ambiguous until we later infer `_` to
4 // `{integer}`.
5
6 // check-pass
7
8 trait PrimeField: Sized {
9     type Repr: From<u64> + From<Self>;
10     type Repr2: From<Self> + From<u64>;
11
12     fn method() {
13         Self::Repr::from(10);
14         Self::Repr2::from(10);
15     }
16 }
17
18 fn function<T: PrimeField>() {
19     T::Repr::from(10);
20     T::Repr2::from(10);
21 }
22
23 fn main() {}