From 91bfa2c829e4a0ca01a75ec5f70e04717f0b4813 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Sun, 28 Aug 2016 19:28:31 -0400 Subject: [PATCH] Add test for #24204 Closes #24204 --- src/test/compile-fail/issue-24204.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/compile-fail/issue-24204.rs diff --git a/src/test/compile-fail/issue-24204.rs b/src/test/compile-fail/issue-24204.rs new file mode 100644 index 0000000000000..2a012da0083bc --- /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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(dead_code)] + +trait MultiDispatch { + type O; +} + +trait Trait: Sized { + type A: MultiDispatch; + type B; + + fn new(u: U) -> >::O where Self::A : MultiDispatch; +} + +fn test>(b: i32) -> T where T::A: MultiDispatch { T::new(b) } +//~^ ERROR type mismatch resolving + +fn main() {}