diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-03-16 18:45:01 +0200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-04-14 21:55:42 +1200 |
| commit | 4e8e64140ff60d1a20d7e54369db714a9fcd8b96 (patch) | |
| tree | 2b3a26030c79205545f0d66e766a72ecef5f0e70 /src/test/compile-fail | |
| parent | a4eb5a66a5b33b209a1263830d89d83381a42ccb (diff) | |
| download | rust-4e8e64140ff60d1a20d7e54369db714a9fcd8b96.tar.gz rust-4e8e64140ff60d1a20d7e54369db714a9fcd8b96.zip | |
eddyb's refactoring of coercions/adjustments
Diffstat (limited to 'src/test/compile-fail')
5 files changed, 33 insertions, 4 deletions
diff --git a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs index c55e24e81ad..c18d72c445b 100644 --- a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs +++ b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs @@ -34,6 +34,8 @@ fn dent<C:BoxCar>(c: C, color: C::Color) { fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) { //~^ ERROR ambiguous associated type + //~| ERROR the associated type `Color` (from the trait `Box`) must be specified + //~| ERROR the associated type `Color` (from the trait `Vehicle`) must be specified } fn paint<C:BoxCar>(c: C, d: C::Color) { diff --git a/src/test/compile-fail/issue-18819.rs b/src/test/compile-fail/issue-18819.rs index 951d78410b8..01fc4fef03b 100644 --- a/src/test/compile-fail/issue-18819.rs +++ b/src/test/compile-fail/issue-18819.rs @@ -20,7 +20,7 @@ impl Foo for X { type Item = bool; } -fn print_x(_: &Foo, extra: &str) { +fn print_x(_: &Foo<Item=bool>, extra: &str) { println!("{}", extra); } diff --git a/src/test/compile-fail/issue-19482.rs b/src/test/compile-fail/issue-19482.rs new file mode 100644 index 00000000000..21a50f24d5e --- /dev/null +++ b/src/test/compile-fail/issue-19482.rs @@ -0,0 +1,25 @@ +// 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 <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. + +// Test that a partially specified trait object with unspecified associated +// type does not type-check. + +// pretty-expanded FIXME #23616 + +trait Foo { + type A; + + fn dummy(&self) { } +} + +fn bar(x: &Foo) {} +//~^ ERROR the associated type `A` (from the trait `Foo`) must be specified + +pub fn main() {} diff --git a/src/test/compile-fail/retslot-cast.rs b/src/test/compile-fail/retslot-cast.rs index 4ef07ecb438..c5e26a26744 100644 --- a/src/test/compile-fail/retslot-cast.rs +++ b/src/test/compile-fail/retslot-cast.rs @@ -11,7 +11,8 @@ #![feature(rustc_attrs)] #![allow(warnings)] -pub fn fail(x: Option<& (Iterator+Send)>) -> Option<&Iterator> { +pub fn fail(x: Option<&(Iterator<Item=()>+Send)>) + -> Option<&Iterator<Item=()>> { // This call used to trigger an LLVM assertion because the return // slot had type "Option<&Iterator>"* instead of // "Option<&(Iterator+Send)>"* -- but this now yields a @@ -23,7 +24,8 @@ pub fn fail(x: Option<& (Iterator+Send)>) -> Option<&Iterator> { inner(x) //~ ERROR mismatched types } -pub fn inner(x: Option<& (Iterator+Send)>) -> Option<&(Iterator+Send)> { +pub fn inner(x: Option<&(Iterator<Item=()>+Send)>) + -> Option<&(Iterator<Item=()>+Send)> { x } diff --git a/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs b/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs index 55156e28cd7..5a821ef1231 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs @@ -11,7 +11,7 @@ // Test that the `Fn` traits require `()` form without a feature gate. -fn bar1(x: &Fn<()>) { +fn bar1(x: &Fn<(), Output=()>) { //~^ ERROR angle-bracket notation is not stable when used with the `Fn` family } |
