diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2020-07-25 14:00:13 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2020-10-06 11:19:32 +0100 |
| commit | ed324825341dbc763a8044f769eb0544afe87f08 (patch) | |
| tree | c9bdcaff7454cec592c3e28a5cc6ea43e816bde3 /src/test | |
| parent | 0dfa6ff3be2316f91b7f148ff30617287278617a (diff) | |
| download | rust-ed324825341dbc763a8044f769eb0544afe87f08.tar.gz rust-ed324825341dbc763a8044f769eb0544afe87f08.zip | |
Handle multiple trait-def projection candidates
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/associated-types/associated-types-projection-bound-ambiguity.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-projection-bound-ambiguity.rs b/src/test/ui/associated-types/associated-types-projection-bound-ambiguity.rs new file mode 100644 index 00000000000..353f82e7c6e --- /dev/null +++ b/src/test/ui/associated-types/associated-types-projection-bound-ambiguity.rs @@ -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() {} |
