From 2a12e51dbd6949ae17925af9f3c4cc7402aa1b9b Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Thu, 7 May 2015 22:21:57 +0300 Subject: Select projections over impls in case of ambiguity. Fixes #23336. --- src/test/run-pass/issue-23336.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/run-pass/issue-23336.rs (limited to 'src/test') diff --git a/src/test/run-pass/issue-23336.rs b/src/test/run-pass/issue-23336.rs new file mode 100644 index 00000000000..21e51298444 --- /dev/null +++ b/src/test/run-pass/issue-23336.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Data { fn doit(&self) {} } +impl Data for T {} +pub trait UnaryLogic { type D: Data; } +impl UnaryLogic for () { type D = i32; } + +pub fn crashes(t: T::D) { + t.doit(); +} + +fn main() { crashes::<()>(0); } -- cgit 1.4.1-3-g733a5