Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle multiple trait-def projection candidates
- Loading branch information
1 parent
0dfa6ff
commit ed32482
Showing
2 changed files
with
23 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
src/test/ui/associated-types/associated-types-projection-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,16 @@ | ||
// Check that if we have multiple applicable projection bounds we pick one (for | ||
// backwards compatibility reasons). | ||
|
||
// check-pass | ||
use std::ops::Mul; | ||
|
||
trait A { | ||
type V; | ||
type U: Mul<Self::V, Output = ()> + Mul<(), Output = ()>; | ||
} | ||
|
||
fn g<T: A<V = ()>>() { | ||
let y: <T::U as Mul<()>>::Output = (); | ||
} | ||
|
||
fn main() {} |