diff options
| author | Andrew Paseltiner <apaseltiner@gmail.com> | 2016-08-28 19:28:31 -0400 |
|---|---|---|
| committer | Andrew Paseltiner <apaseltiner@gmail.com> | 2016-08-28 19:45:20 -0400 |
| commit | 91bfa2c829e4a0ca01a75ec5f70e04717f0b4813 (patch) | |
| tree | 4267450e8cbcd8e395b89c8079a6097e6b153454 /src | |
| parent | e4791e086d671d429db864787f6b60547a28b0f5 (diff) | |
| download | rust-91bfa2c829e4a0ca01a75ec5f70e04717f0b4813.tar.gz rust-91bfa2c829e4a0ca01a75ec5f70e04717f0b4813.zip | |
Add test for #24204
Closes #24204
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/issue-24204.rs | 27 |
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() {} |
