Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle multiple applicable projection candidates
- Loading branch information
1 parent
bc08b79
commit cfee495
Showing
6 changed files
with
82 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/ui/associated-types/associated-types-bound-ambiguity.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Make sure that if there are multiple applicable bounds on a projection, we | ||
// consider them ambiguous. In this test we are initially trying to solve | ||
// `Self::Repr: From<_>`, which is ambiguous until we later infer `_` to | ||
// `{integer}`. | ||
|
||
// check-pass | ||
|
||
trait PrimeField: Sized { | ||
type Repr: From<u64> + From<Self>; | ||
type Repr2: From<Self> + From<u64>; | ||
|
||
fn method() { | ||
Self::Repr::from(10); | ||
Self::Repr2::from(10); | ||
} | ||
} | ||
|
||
fn function<T: PrimeField>() { | ||
T::Repr::from(10); | ||
T::Repr2::from(10); | ||
} | ||
|
||
fn main() {} |