about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-31 06:29:09 -0700
committerGitHub <noreply@github.com>2016-08-31 06:29:09 -0700
commit18b5ae301978a2afeac20b9e38d0ebd71eb49752 (patch)
tree4c32aefbc62a884879e2b1318af5ffbf207b7ea1
parent44113e603b1c1b45b61146036ec9f01cc43426af (diff)
parent91bfa2c829e4a0ca01a75ec5f70e04717f0b4813 (diff)
downloadrust-18b5ae301978a2afeac20b9e38d0ebd71eb49752.tar.gz
rust-18b5ae301978a2afeac20b9e38d0ebd71eb49752.zip
Rollup merge of #36089 - apasel422:issue-24204, r=alexcrichton
Add test for #24204

Closes #24204
-rw-r--r--src/test/compile-fail/issue-24204.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-24204.rs b/src/test/compile-fail/issue-24204.rs
new file mode 100644
index 00000000000..2a012da0083
--- /dev/null
+++ b/src/test/compile-fail/issue-24204.rs
@@ -0,0 +1,27 @@
+// Copyright 2016 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(dead_code)]
+
+trait MultiDispatch<T> {
+    type O;
+}
+
+trait Trait: Sized {
+    type A: MultiDispatch<Self::B, O = Self>;
+    type B;
+
+    fn new<U>(u: U) -> <Self::A as MultiDispatch<U>>::O where Self::A : MultiDispatch<U>;
+}
+
+fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { T::new(b) }
+//~^ ERROR type mismatch resolving
+
+fn main() {}