auto merge of #16699 : treeman/rust/issue-8492, r=alexcrichton
Closes #8492. I did not find this suggestion in the [guidelines][] but it's mentioned in the [old style guide][]. [guidelines]: https://github.com/rust-lang/rust-guidelines [old style guide]: https://github.com/rust-lang/rust/wiki/Note-style-guide/73c864a10a8e231e2a6630e5a3461f1d3022a20a
This commit is contained in:
commit
0b3e43d2a4
118 changed files with 266 additions and 266 deletions
|
|
@ -29,7 +29,7 @@ pub fn main() {
|
|||
unsafe {
|
||||
// comma in place of a colon
|
||||
asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8u) : "cc", "volatile");
|
||||
//~^ WARNING expected a clobber, but found an option
|
||||
//~^ WARNING expected a clobber, found an option
|
||||
}
|
||||
assert_eq!(x, 13);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
fn bad_bang(i: uint) -> ! {
|
||||
return 7u;
|
||||
//~^ ERROR expected `!` but found `uint`
|
||||
//~^ ERROR expected `!`, found `uint`
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5u); }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
fn bad_bang(i: uint) -> ! {
|
||||
if i < 0u { } else { fail!(); }
|
||||
//~^ ERROR expected `!` but found `()`
|
||||
//~^ ERROR expected `!`, found `()`
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5u); }
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:expected `collections::string::String` but found `int`
|
||||
// error-pattern:expected `collections::string::String`, found `int`
|
||||
|
||||
static i: String = 10i;
|
||||
fn main() { println!("{}", i); }
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn f() -> ! {
|
||||
3i //~ ERROR expected `!` but found `int`
|
||||
3i //~ ERROR expected `!`, found `int`
|
||||
}
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:mismatched types: expected `()` but found `bool`
|
||||
// error-pattern:mismatched types: expected `()`, found `bool`
|
||||
|
||||
fn main() {
|
||||
loop {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:mismatched types: expected `()` but found `bool`
|
||||
// error-pattern:mismatched types: expected `()`, found `bool`
|
||||
|
||||
struct r;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:mismatched types: expected `()` but found `bool`
|
||||
// error-pattern:mismatched types: expected `()`, found `bool`
|
||||
|
||||
fn main() {
|
||||
while true {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fn give_any(f: ||:) {
|
|||
|
||||
fn give_owned(f: ||:Send) {
|
||||
take_any(f);
|
||||
take_const_owned(f); //~ ERROR expected bounds `Send+Sync` but found bounds `Send`
|
||||
take_const_owned(f); //~ ERROR expected bounds `Send+Sync`, found bounds `Send`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
# //~ ERROR 11:1: 11:2 error: expected `[` but found `<eof>`
|
||||
# //~ ERROR 11:1: 11:2 error: expected `[`, found `<eof>`
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
impl Foo; //~ ERROR expected `{` but found `;`
|
||||
impl Foo; //~ ERROR expected `{`, found `;`
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ struct Foo<'a,'b> {
|
|||
impl<'a,'b> Foo<'a,'b> {
|
||||
// The number of errors is related to the way invariance works.
|
||||
fn bar(self: Foo<'b,'a>) {}
|
||||
//~^ ERROR mismatched types: expected `Foo<'a,'b>` but found `Foo<'b,'a>`
|
||||
//~^^ ERROR mismatched types: expected `Foo<'a,'b>` but found `Foo<'b,'a>`
|
||||
//~^^^ ERROR mismatched types: expected `Foo<'b,'a>` but found `Foo<'a,'b>`
|
||||
//~^^^^ ERROR mismatched types: expected `Foo<'b,'a>` but found `Foo<'a,'b>`
|
||||
//~^ ERROR mismatched types: expected `Foo<'a,'b>`, found `Foo<'b,'a>`
|
||||
//~^^ ERROR mismatched types: expected `Foo<'a,'b>`, found `Foo<'b,'a>`
|
||||
//~^^^ ERROR mismatched types: expected `Foo<'b,'a>`, found `Foo<'a,'b>`
|
||||
//~^^^^ ERROR mismatched types: expected `Foo<'b,'a>`, found `Foo<'a,'b>`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@
|
|||
// Verifies that the expected token errors for `extern crate` are
|
||||
// raised
|
||||
|
||||
extern "C" mod foo; //~ERROR expected `{` or `fn` but found `mod`
|
||||
extern "C" mod foo; //~ERROR expected `{` or `fn`, found `mod`
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@
|
|||
// Verifies that the expected token errors for `extern crate` are
|
||||
// raised
|
||||
|
||||
extern crate foo {} //~ERROR expected one of `=`, `;` but found `{`
|
||||
extern crate foo {} //~ERROR expected one of `=`, `;`, found `{`
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ mod y {
|
|||
|
||||
fn bar(x: x::foo) -> y::foo {
|
||||
return x;
|
||||
//~^ ERROR mismatched types: expected `y::foo` but found `x::foo`
|
||||
//~^ ERROR mismatched types: expected `y::foo`, found `x::foo`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type T2 = int;
|
|||
|
||||
fn bar(x: T1) -> T2 {
|
||||
return x;
|
||||
//~^ ERROR mismatched types: expected `T2` but found `T1`
|
||||
//~^ ERROR mismatched types: expected `T2`, found `T1`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ struct Heap;
|
|||
struct Vec<T, A = Heap>;
|
||||
|
||||
fn main() {
|
||||
let _: Vec; //~ ERROR wrong number of type arguments: expected at least 1 but found 0
|
||||
let _: Vec; //~ ERROR wrong number of type arguments: expected at least 1, found 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ struct Vec<T, A = Heap>;
|
|||
|
||||
fn main() {
|
||||
let _: Vec<int, Heap, bool>;
|
||||
//~^ ERROR wrong number of type arguments: expected at most 2 but found 3
|
||||
//~^ ERROR wrong number of type arguments: expected at most 2, found 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,23 +21,23 @@ struct HashMap<K, V, H = Hash<K>>;
|
|||
fn main() {
|
||||
// Ensure that the printed type doesn't include the default type params...
|
||||
let _: Foo<int> = ();
|
||||
//~^ ERROR mismatched types: expected `Foo<int>` but found `()`
|
||||
//~^ ERROR mismatched types: expected `Foo<int>`, found `()`
|
||||
|
||||
// ...even when they're present, but the same types as the defaults.
|
||||
let _: Foo<int, B, C> = ();
|
||||
//~^ ERROR mismatched types: expected `Foo<int>` but found `()`
|
||||
//~^ ERROR mismatched types: expected `Foo<int>`, found `()`
|
||||
|
||||
// Including cases where the default is using previous type params.
|
||||
let _: HashMap<String, int> = ();
|
||||
//~^ ERROR mismatched types: expected `HashMap<collections::string::String,int>` but found `()`
|
||||
//~^ ERROR mismatched types: expected `HashMap<collections::string::String,int>`, found `()`
|
||||
let _: HashMap<String, int, Hash<String>> = ();
|
||||
//~^ ERROR mismatched types: expected `HashMap<collections::string::String,int>` but found `()`
|
||||
//~^ ERROR mismatched types: expected `HashMap<collections::string::String,int>`, found `()`
|
||||
|
||||
// But not when there's a different type in between.
|
||||
let _: Foo<A, int, C> = ();
|
||||
//~^ ERROR mismatched types: expected `Foo<A,int>` but found `()`
|
||||
//~^ ERROR mismatched types: expected `Foo<A,int>`, found `()`
|
||||
|
||||
// And don't print <> at all when there's just defaults.
|
||||
let _: Foo<A, B, C> = ();
|
||||
//~^ ERROR mismatched types: expected `Foo` but found `()`
|
||||
//~^ ERROR mismatched types: expected `Foo`, found `()`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
|
||||
fn main() {
|
||||
let x = if true { 10i } else { 10u };
|
||||
//~^ ERROR if and else have incompatible types: expected `int` but found `uint`
|
||||
//~^ ERROR if and else have incompatible types: expected `int`, found `uint`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:mismatched types: expected `()` but found `bool`
|
||||
// error-pattern:mismatched types: expected `()`, found `bool`
|
||||
|
||||
extern crate debug;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#![feature(struct_inherit)]
|
||||
|
||||
// With lifetime parameters.
|
||||
struct S5<'a> : S4 { //~ ERROR wrong number of lifetime parameters: expected 1 but found 0
|
||||
struct S5<'a> : S4 { //~ ERROR wrong number of lifetime parameters: expected 1, found 0
|
||||
f4: int,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,62 +39,62 @@ fn main() {
|
|||
fn id_u64(n: u64) -> u64 { n }
|
||||
|
||||
id_i8(a8); // ok
|
||||
id_i8(a16); //~ ERROR mismatched types: expected `i8` but found `i16`
|
||||
id_i8(a32); //~ ERROR mismatched types: expected `i8` but found `i32`
|
||||
id_i8(a64); //~ ERROR mismatched types: expected `i8` but found `i64`
|
||||
id_i8(a16); //~ ERROR mismatched types: expected `i8`, found `i16`
|
||||
id_i8(a32); //~ ERROR mismatched types: expected `i8`, found `i32`
|
||||
id_i8(a64); //~ ERROR mismatched types: expected `i8`, found `i64`
|
||||
|
||||
id_i16(a8); //~ ERROR mismatched types: expected `i16` but found `i8`
|
||||
id_i16(a8); //~ ERROR mismatched types: expected `i16`, found `i8`
|
||||
id_i16(a16); // ok
|
||||
id_i16(a32); //~ ERROR mismatched types: expected `i16` but found `i32`
|
||||
id_i16(a64); //~ ERROR mismatched types: expected `i16` but found `i64`
|
||||
id_i16(a32); //~ ERROR mismatched types: expected `i16`, found `i32`
|
||||
id_i16(a64); //~ ERROR mismatched types: expected `i16`, found `i64`
|
||||
|
||||
id_i32(a8); //~ ERROR mismatched types: expected `i32` but found `i8`
|
||||
id_i32(a16); //~ ERROR mismatched types: expected `i32` but found `i16`
|
||||
id_i32(a8); //~ ERROR mismatched types: expected `i32`, found `i8`
|
||||
id_i32(a16); //~ ERROR mismatched types: expected `i32`, found `i16`
|
||||
id_i32(a32); // ok
|
||||
id_i32(a64); //~ ERROR mismatched types: expected `i32` but found `i64`
|
||||
id_i32(a64); //~ ERROR mismatched types: expected `i32`, found `i64`
|
||||
|
||||
id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8`
|
||||
id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16`
|
||||
id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32`
|
||||
id_i64(a8); //~ ERROR mismatched types: expected `i64`, found `i8`
|
||||
id_i64(a16); //~ ERROR mismatched types: expected `i64`, found `i16`
|
||||
id_i64(a32); //~ ERROR mismatched types: expected `i64`, found `i32`
|
||||
id_i64(a64); // ok
|
||||
|
||||
id_i8(c8); // ok
|
||||
id_i8(c16); //~ ERROR mismatched types: expected `i8` but found `i16`
|
||||
id_i8(c32); //~ ERROR mismatched types: expected `i8` but found `i32`
|
||||
id_i8(c64); //~ ERROR mismatched types: expected `i8` but found `i64`
|
||||
id_i8(c16); //~ ERROR mismatched types: expected `i8`, found `i16`
|
||||
id_i8(c32); //~ ERROR mismatched types: expected `i8`, found `i32`
|
||||
id_i8(c64); //~ ERROR mismatched types: expected `i8`, found `i64`
|
||||
|
||||
id_i16(c8); //~ ERROR mismatched types: expected `i16` but found `i8`
|
||||
id_i16(c8); //~ ERROR mismatched types: expected `i16`, found `i8`
|
||||
id_i16(c16); // ok
|
||||
id_i16(c32); //~ ERROR mismatched types: expected `i16` but found `i32`
|
||||
id_i16(c64); //~ ERROR mismatched types: expected `i16` but found `i64`
|
||||
id_i16(c32); //~ ERROR mismatched types: expected `i16`, found `i32`
|
||||
id_i16(c64); //~ ERROR mismatched types: expected `i16`, found `i64`
|
||||
|
||||
id_i32(c8); //~ ERROR mismatched types: expected `i32` but found `i8`
|
||||
id_i32(c16); //~ ERROR mismatched types: expected `i32` but found `i16`
|
||||
id_i32(c8); //~ ERROR mismatched types: expected `i32`, found `i8`
|
||||
id_i32(c16); //~ ERROR mismatched types: expected `i32`, found `i16`
|
||||
id_i32(c32); // ok
|
||||
id_i32(c64); //~ ERROR mismatched types: expected `i32` but found `i64`
|
||||
id_i32(c64); //~ ERROR mismatched types: expected `i32`, found `i64`
|
||||
|
||||
id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8`
|
||||
id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16`
|
||||
id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32`
|
||||
id_i64(a8); //~ ERROR mismatched types: expected `i64`, found `i8`
|
||||
id_i64(a16); //~ ERROR mismatched types: expected `i64`, found `i16`
|
||||
id_i64(a32); //~ ERROR mismatched types: expected `i64`, found `i32`
|
||||
id_i64(a64); // ok
|
||||
|
||||
id_u8(b8); // ok
|
||||
id_u8(b16); //~ ERROR mismatched types: expected `u8` but found `u16`
|
||||
id_u8(b32); //~ ERROR mismatched types: expected `u8` but found `u32`
|
||||
id_u8(b64); //~ ERROR mismatched types: expected `u8` but found `u64`
|
||||
id_u8(b16); //~ ERROR mismatched types: expected `u8`, found `u16`
|
||||
id_u8(b32); //~ ERROR mismatched types: expected `u8`, found `u32`
|
||||
id_u8(b64); //~ ERROR mismatched types: expected `u8`, found `u64`
|
||||
|
||||
id_u16(b8); //~ ERROR mismatched types: expected `u16` but found `u8`
|
||||
id_u16(b8); //~ ERROR mismatched types: expected `u16`, found `u8`
|
||||
id_u16(b16); // ok
|
||||
id_u16(b32); //~ ERROR mismatched types: expected `u16` but found `u32`
|
||||
id_u16(b64); //~ ERROR mismatched types: expected `u16` but found `u64`
|
||||
id_u16(b32); //~ ERROR mismatched types: expected `u16`, found `u32`
|
||||
id_u16(b64); //~ ERROR mismatched types: expected `u16`, found `u64`
|
||||
|
||||
id_u32(b8); //~ ERROR mismatched types: expected `u32` but found `u8`
|
||||
id_u32(b16); //~ ERROR mismatched types: expected `u32` but found `u16`
|
||||
id_u32(b8); //~ ERROR mismatched types: expected `u32`, found `u8`
|
||||
id_u32(b16); //~ ERROR mismatched types: expected `u32`, found `u16`
|
||||
id_u32(b32); // ok
|
||||
id_u32(b64); //~ ERROR mismatched types: expected `u32` but found `u64`
|
||||
id_u32(b64); //~ ERROR mismatched types: expected `u32`, found `u64`
|
||||
|
||||
id_u64(b8); //~ ERROR mismatched types: expected `u64` but found `u8`
|
||||
id_u64(b16); //~ ERROR mismatched types: expected `u64` but found `u16`
|
||||
id_u64(b32); //~ ERROR mismatched types: expected `u64` but found `u32`
|
||||
id_u64(b8); //~ ERROR mismatched types: expected `u64`, found `u8`
|
||||
id_u64(b16); //~ ERROR mismatched types: expected `u64`, found `u16`
|
||||
id_u64(b32); //~ ERROR mismatched types: expected `u64`, found `u32`
|
||||
id_u64(b64); // ok
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ fn f(_: extern "Rust" fn()) {}
|
|||
extern fn bar() {}
|
||||
|
||||
fn main() { f(bar) }
|
||||
//~^ ERROR: expected `fn()` but found `extern "C" fn()`
|
||||
//~^ ERROR: expected `fn()`, found `extern "C" fn()`
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn main() {
|
||||
match Some(10) {
|
||||
//~^ ERROR match arms have incompatible types: expected `bool` but found `()`
|
||||
//~^ ERROR match arms have incompatible types: expected `bool`, found `()`
|
||||
Some(5) => false,
|
||||
Some(2) => true,
|
||||
None => (), //~ NOTE match arm with an incompatible type
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ struct Test<'s> {
|
|||
|
||||
fn main() {
|
||||
let test = box Test { func: proc() {} };
|
||||
//~^ ERROR: expected `||` but found `proc()`
|
||||
//~^ ERROR: expected `||`, found `proc()`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@
|
|||
|
||||
//! Test that makes sure wrongly-typed bench functions are rejected
|
||||
|
||||
// error-pattern:expected &-ptr but found int
|
||||
// error-pattern:expected &-ptr, found int
|
||||
#[bench]
|
||||
fn bar(x: int) { }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
let x = [1,2];
|
||||
let y = match x {
|
||||
[] => None,
|
||||
//~^ ERROR expected `[<generic integer #1>, .. 2]` but found a fixed vector pattern of size 0
|
||||
//~^ ERROR expected `[<generic integer #1>, .. 2]`, found a fixed vector pattern of size 0
|
||||
[a,_] => Some(a)
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ fn expect_proc(_: proc()) {}
|
|||
|
||||
fn main() {
|
||||
expect_closure(proc() {});
|
||||
//~^ ERROR mismatched types: expected `||` but found `proc()` (expected closure, found proc)
|
||||
//~^ ERROR mismatched types: expected `||`, found `proc()` (expected closure, found proc)
|
||||
|
||||
expect_proc(|| {});
|
||||
//~^ ERROR mismatched types: expected `proc()` but found `||` (expected proc, found closure)
|
||||
//~^ ERROR mismatched types: expected `proc()`, found `||` (expected proc, found closure)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ struct X {
|
|||
fn main() {
|
||||
let x = X { a: [0] };
|
||||
let _f = &x.a as *mut u8;
|
||||
//~^ ERROR mismatched types: expected `*mut u8` but found `&[u8, .. 1]`
|
||||
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
|
||||
|
||||
let local = [0u8];
|
||||
let _v = &local as *mut u8;
|
||||
//~^ ERROR mismatched types: expected `*mut u8` but found `&[u8, .. 1]`
|
||||
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct Shower<T> {
|
|||
|
||||
impl<T: fmt::Show> ops::Fn<(), ()> for Shower<T> {
|
||||
fn call(&self, _args: ()) {
|
||||
//~^ ERROR `call` has an incompatible type for trait: expected "rust-call" fn but found "Rust" fn
|
||||
//~^ ERROR `call` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn
|
||||
println!("{}", self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ use std::raw::Slice;
|
|||
|
||||
fn main() {
|
||||
let Slice { data: data, len: len } = "foo";
|
||||
//~^ ERROR mismatched types: expected `&'static str` but found a structure pattern
|
||||
//~^ ERROR mismatched types: expected `&'static str`, found a structure pattern
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use std::raw::Slice;
|
|||
fn main() {
|
||||
match () {
|
||||
Slice { data: data, len: len } => (),
|
||||
//~^ ERROR mismatched types: expected `()` but found a structure pattern
|
||||
//~^ ERROR mismatched types: expected `()`, found a structure pattern
|
||||
_ => unreachable!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:expected `[` but found `vec`
|
||||
// error-pattern:expected `[`, found `vec`
|
||||
mod blade_runner {
|
||||
#vec[doc(
|
||||
brief = "Blade Runner is probably the best movie ever",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn foo<T, U>(x: T, y: U) {
|
||||
let mut xx = x;
|
||||
xx = y; //~ ERROR expected `T` but found `U`
|
||||
xx = y; //~ ERROR expected `T`, found `U`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@
|
|||
fn main()
|
||||
{
|
||||
let x = 3
|
||||
} //~ ERROR: expected `;` but found `}`
|
||||
} //~ ERROR: expected `;`, found `}`
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let _p: char = 100; //~ ERROR mismatched types: expected `char` but found
|
||||
let _p: char = 100; //~ ERROR mismatched types: expected `char`, found
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ fn main() {
|
|||
match None {
|
||||
Err(_) => ()
|
||||
//~^ ERROR mismatched types: expected `core::option::Option<<generic #1>>`
|
||||
// but found `core::result::Result<<generic #2>,<generic #3>>`
|
||||
// , found `core::result::Result<<generic #2>,<generic #3>>`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ fn bar(int_param: int) {}
|
|||
fn main() {
|
||||
let foo: [u8, ..4] = [1u8, ..4u];
|
||||
bar(foo);
|
||||
//~^ ERROR mismatched types: expected `int` but found `[u8, .. 4]`
|
||||
// (expected int but found vector)
|
||||
//~^ ERROR mismatched types: expected `int`, found `[u8, .. 4]`
|
||||
// (expected int, found vector)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@
|
|||
static A: (int,int) = (4,2);
|
||||
fn main() {
|
||||
match 42 { A => () }
|
||||
//~^ ERROR mismatched types: expected `<generic integer #0>` but found `(int,int)`
|
||||
// (expected integral variable but found tuple)
|
||||
//~^ ERROR mismatched types: expected `<generic integer #0>`, found `(int,int)`
|
||||
// (expected integral variable, found tuple)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,33 +12,33 @@ enum A { B, C }
|
|||
|
||||
fn main() {
|
||||
match (true, false) {
|
||||
B => (), //~ ERROR expected `(bool,bool)` but found an enum or structure pattern
|
||||
B => (), //~ ERROR expected `(bool,bool)`, found an enum or structure pattern
|
||||
_ => ()
|
||||
}
|
||||
|
||||
match (true, false) {
|
||||
(true, false, false) => ()
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)` but found tuple
|
||||
// (expected a tuple with 2 elements but found one with 3 elements)
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)`, found tuple
|
||||
// (expected a tuple with 2 elements, found one with 3 elements)
|
||||
}
|
||||
|
||||
match (true, false) {
|
||||
box (true, false) => ()
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)` but found a box pattern
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)`, found a box pattern
|
||||
}
|
||||
|
||||
match (true, false) {
|
||||
&(true, false) => ()
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)` but found an `&`-pointer pattern
|
||||
//~^ ERROR mismatched types: expected `(bool,bool)`, found an `&`-pointer pattern
|
||||
}
|
||||
|
||||
|
||||
let v = [('a', 'b') //~ ERROR expected function but found `(char,char)`
|
||||
let v = [('a', 'b') //~ ERROR expected function, found `(char,char)`
|
||||
('c', 'd'),
|
||||
('e', 'f')];
|
||||
|
||||
for &(x,y) in v.iter() {} // should be OK
|
||||
|
||||
// Make sure none of the errors above were fatal
|
||||
let x: char = true; //~ ERROR expected `char` but found `bool`
|
||||
let x: char = true; //~ ERROR expected `char`, found `bool`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct S(Either<uint, uint>);
|
|||
|
||||
fn main() {
|
||||
match S(Left(5)) {
|
||||
Right(_) => {} //~ ERROR mismatched types: expected `S` but found `Either
|
||||
Right(_) => {} //~ ERROR mismatched types: expected `S`, found `Either
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
trait Foo { fn a() } //~ ERROR expected `;` or `{` but found `}`
|
||||
trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}`
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct BarStruct;
|
|||
|
||||
impl<'a> BarStruct {
|
||||
fn foo(&'a mut self) -> Gc<BarStruct> { self }
|
||||
//~^ ERROR: error: mismatched types: expected `Gc<BarStruct>` but found `&'a mut BarStruct
|
||||
//~^ ERROR: error: mismatched types: expected `Gc<BarStruct>`, found `&'a mut BarStruct
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ enum Whatever {
|
|||
fn foo(x: Whatever) {
|
||||
match x {
|
||||
Some(field) => field.access(),
|
||||
//~^ ERROR: mismatched types: expected `Whatever` but found
|
||||
//~^ ERROR: mismatched types: expected `Whatever`, found
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
enum Foo {
|
||||
A = 1i64,
|
||||
//~^ ERROR mismatched types: expected `int` but found `i64`
|
||||
//~^ ERROR mismatched types: expected `int`, found `i64`
|
||||
B = 2u8
|
||||
//~^ ERROR mismatched types: expected `int` but found `u8`
|
||||
//~^ ERROR mismatched types: expected `int`, found `u8`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ fn bar(_s: u32) { }
|
|||
|
||||
fn main() {
|
||||
foo(1*(1 as int));
|
||||
//~^ ERROR: mismatched types: expected `i16` but found `int` (expected `i16` but found `int`)
|
||||
//~^ ERROR: mismatched types: expected `i16`, found `int` (expected `i16`, found `int`)
|
||||
|
||||
bar(1*(1 as uint));
|
||||
//~^ ERROR: mismatched types: expected `u32` but found `uint` (expected `u32` but found `uint`)
|
||||
//~^ ERROR: mismatched types: expected `u32`, found `uint` (expected `u32`, found `uint`)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fn forever() -> ! {
|
|||
loop {
|
||||
break;
|
||||
}
|
||||
return 42i; //~ ERROR expected `!` but found `int`
|
||||
return 42i; //~ ERROR expected `!`, found `int`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
foo! bar < //~ ERROR expected `(` or `{`, but found `<`
|
||||
foo! bar < //~ ERROR expected `(` or `{`, found `<`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ enum E { C(int) }
|
|||
|
||||
fn main() {
|
||||
match (S { a: 1 }) {
|
||||
C(_) => (), //~ ERROR mismatched types: expected `S` but found `E`
|
||||
C(_) => (), //~ ERROR mismatched types: expected `S`, found `E`
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
fn main() {
|
||||
match () {
|
||||
[()] => { } //~ ERROR mismatched types: expected `()` but found a vector pattern
|
||||
[()] => { } //~ ERROR mismatched types: expected `()`, found a vector pattern
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct S {
|
|||
y: int
|
||||
}
|
||||
|
||||
impl Cmp, ToString for S { //~ ERROR: expected `{` but found `,`
|
||||
impl Cmp, ToString for S { //~ ERROR: expected `{`, found `,`
|
||||
fn eq(&&other: S) { false }
|
||||
fn to_string(&self) -> String { "hi".to_string() }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
|
||||
pub fn main() {
|
||||
struct Foo { x: int }
|
||||
let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected `;` but found `{`
|
||||
let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected `;`, found `{`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ fn main() {
|
|||
// because the def_id associated with the type was
|
||||
// not convertible to a path.
|
||||
let x: int = noexporttypelib::foo();
|
||||
//~^ ERROR expected `int` but found `core::option::Option<int>`
|
||||
//~^ ERROR expected `int`, found `core::option::Option<int>`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ enum State { ST_NULL, ST_WHITESPACE }
|
|||
|
||||
fn main() {
|
||||
[ST_NULL, ..(ST_WHITESPACE as uint)];
|
||||
//~^ ERROR expected constant integer for repeat count but found variable
|
||||
//~^ ERROR expected constant integer for repeat count, found variable
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@
|
|||
|
||||
fn main() {
|
||||
fn bar(n: uint) {
|
||||
let _x = [0, ..n]; //~ ERROR expected constant integer for repeat count but found variable
|
||||
let _x = [0, ..n]; //~ ERROR expected constant integer for repeat count, found variable
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn foo(x) { //~ ERROR expected `:` but found `)`
|
||||
fn foo(x) { //~ ERROR expected `:`, found `)`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ fn main() {
|
|||
_ => ()
|
||||
}
|
||||
match 'c' {
|
||||
S { .. } => (), //~ ERROR mismatched types: expected `char` but found a structure pattern
|
||||
S { .. } => (), //~ ERROR mismatched types: expected `char`, found a structure pattern
|
||||
|
||||
_ => ()
|
||||
}
|
||||
f(true); //~ ERROR mismatched types: expected `char` but found `bool`
|
||||
f(true); //~ ERROR mismatched types: expected `char`, found `bool`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ fn let_in<T>(x: T, f: |T|) {}
|
|||
|
||||
fn main() {
|
||||
let_in(3u, |i| { assert!(i == 3i); });
|
||||
//~^ ERROR expected `uint` but found `int`
|
||||
//~^ ERROR expected `uint`, found `int`
|
||||
|
||||
let_in(3i, |i| { assert!(i == 3u); });
|
||||
//~^ ERROR expected `int` but found `uint`
|
||||
//~^ ERROR expected `int`, found `uint`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
|
||||
static s: &'static str =
|
||||
r#"
|
||||
"## //~ ERROR expected `;` but found `#`
|
||||
"## //~ ERROR expected `;`, found `#`
|
||||
;
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ struct an_enum<'a>(&'a int);
|
|||
struct a_class<'a> { x:&'a int }
|
||||
|
||||
fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> {
|
||||
return e; //~ ERROR mismatched types: expected `an_enum<'b>` but found `an_enum<'a>`
|
||||
return e; //~ ERROR mismatched types: expected `an_enum<'b>`, found `an_enum<'a>`
|
||||
//~^ ERROR cannot infer
|
||||
}
|
||||
|
||||
fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> {
|
||||
return e; //~ ERROR mismatched types: expected `a_class<'b>` but found `a_class<'a>`
|
||||
return e; //~ ERROR mismatched types: expected `a_class<'b>`, found `a_class<'a>`
|
||||
//~^ ERROR cannot infer
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ impl<'a> set_f<'a> for c<'a> {
|
|||
}
|
||||
|
||||
fn set_f_bad(&self, b: Gc<b>) {
|
||||
self.f = b; //~ ERROR mismatched types: expected `Gc<Gc<&'a int>>` but found `Gc<Gc<&int>>`
|
||||
self.f = b; //~ ERROR mismatched types: expected `Gc<Gc<&'a int>>`, found `Gc<Gc<&int>>`
|
||||
//~^ ERROR cannot infer
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ trait set_foo_foo {
|
|||
|
||||
impl<'a> set_foo_foo for with_foo<'a> {
|
||||
fn set_foo(&mut self, f: @foo) {
|
||||
self.f = f; //~ ERROR mismatched types: expected `@foo/&self` but found `@foo/&`
|
||||
self.f = f; //~ ERROR mismatched types: expected `@foo/&self`, found `@foo/&`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ trait get_ctxt<'a> {
|
|||
}
|
||||
|
||||
fn make_gc1(gc: @get_ctxt<'a>) -> @get_ctxt<'b> {
|
||||
return gc; //~ ERROR mismatched types: expected `@get_ctxt/&b` but found `@get_ctxt/&a`
|
||||
return gc; //~ ERROR mismatched types: expected `@get_ctxt/&b`, found `@get_ctxt/&a`
|
||||
}
|
||||
|
||||
struct Foo {
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
type closure = Box<lt/fn()>; //~ ERROR expected `,` but found `/`
|
||||
type closure = Box<lt/fn()>; //~ ERROR expected `,`, found `/`
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const i: int = 42; //~ ERROR expected item but found `const`
|
||||
const i: int = 42; //~ ERROR expected item, found `const`
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
enum e = int; //~ ERROR expected `{` but found `=`
|
||||
enum e = int; //~ ERROR expected `{`, found `=`
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
struct s {
|
||||
let foo: (),
|
||||
//~^ ERROR found `let` in ident position
|
||||
//~^^ ERROR expected `:` but found `foo`
|
||||
//~^^ ERROR expected `:`, found `foo`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
|
||||
struct s {
|
||||
bar: ();
|
||||
//~^ ERROR expected `,`, or `}` but found `;`
|
||||
//~^ ERROR expected `,`, or `}`, found `;`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
type v = [int * 3]; //~ ERROR expected `]` but found `*`
|
||||
type v = [int * 3]; //~ ERROR expected `]`, found `*`
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pure fn f() {} //~ ERROR expected item but found `pure`
|
||||
pure fn f() {} //~ ERROR expected item, found `pure`
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn f() {
|
||||
let x: fn~() = || (); //~ ERROR expected `(` but found `~`
|
||||
let x: fn~() = || (); //~ ERROR expected `(`, found `~`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
fn removed_moves() {
|
||||
let mut x = 0;
|
||||
let y <- x;
|
||||
//~^ ERROR expected `;` but found `<-`
|
||||
//~^ ERROR expected `;`, found `<-`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ fn removed_moves() {
|
|||
let mut x = 0;
|
||||
let y = 0;
|
||||
y <- x;
|
||||
//~^ ERROR expected one of `;`, `}` but found `<-`
|
||||
//~^ ERROR expected one of `;`, `}`, found `<-`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
fn f() {
|
||||
let v = [mut 1, 2, 3, 4];
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `]` but found `1`
|
||||
//~^^ ERROR expected `]`, found `1`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
type v = [mut int];
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `]` but found `int`
|
||||
//~^^ ERROR expected `]`, found `int`
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
type bptr = &lifetime/int; //~ ERROR expected `;` but found `/`
|
||||
type bptr = &lifetime/int; //~ ERROR expected `;`, found `/`
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
fn f() {
|
||||
let a_box = box mut 42;
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `;` but found `42`
|
||||
//~^^ ERROR expected `;`, found `42`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
type mut_box = Box<mut int>;
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `,` but found `int`
|
||||
//~^^ ERROR expected `,`, found `int`
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ fn removed_with() {
|
|||
|
||||
let a = S { foo: (), bar: () };
|
||||
let b = S { foo: () with a };
|
||||
//~^ ERROR expected one of `,`, `}` but found `with`
|
||||
//~^ ERROR expected one of `,`, `}`, found `with`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ fn removed_with() {
|
|||
|
||||
let a = S { foo: (), bar: () };
|
||||
let b = S { foo: (), with a };
|
||||
//~^ ERROR expected `:` but found `a`
|
||||
//~^ ERROR expected `:`, found `a`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@
|
|||
|
||||
fn main() {
|
||||
let n = 1;
|
||||
let a = [0, ..n]; //~ ERROR expected constant integer for repeat count but found variable
|
||||
let b = [0, ..()]; //~ ERROR expected positive integer for repeat count but found ()
|
||||
//~^ ERROR: expected `uint` but found `()`
|
||||
let c = [0, ..true]; //~ ERROR expected positive integer for repeat count but found boolean
|
||||
//~^ ERROR: expected `uint` but found `bool`
|
||||
let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count but found float
|
||||
//~^ ERROR: expected `uint` but found `<generic float #0>`
|
||||
let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count but found string
|
||||
//~^ ERROR: expected `uint` but found `&'static str`
|
||||
let a = [0, ..n]; //~ ERROR expected constant integer for repeat count, found variable
|
||||
let b = [0, ..()]; //~ ERROR expected positive integer for repeat count, found ()
|
||||
//~^ ERROR: expected `uint`, found `()`
|
||||
let c = [0, ..true]; //~ ERROR expected positive integer for repeat count, found boolean
|
||||
//~^ ERROR: expected `uint`, found `bool`
|
||||
let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count, found float
|
||||
//~^ ERROR: expected `uint`, found `<generic float #0>`
|
||||
let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count, found string
|
||||
//~^ ERROR: expected `uint`, found `&'static str`
|
||||
let f = [0, ..-4];
|
||||
//~^ ERROR expected positive integer for repeat count but found negative integer
|
||||
//~^ ERROR expected positive integer for repeat count, found negative integer
|
||||
let f = [0u, ..-1];
|
||||
//~^ ERROR expected positive integer for repeat count but found negative integer
|
||||
//~^ ERROR expected positive integer for repeat count, found negative integer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Foo<T,U>(T);
|
|||
fn main() {
|
||||
match Foo(1.1) {
|
||||
1 => {}
|
||||
//~^ ERROR expected `Foo<<generic float #0>,<generic #2>>` but found `<generic integer #0>`
|
||||
//~^ ERROR expected `Foo<<generic float #0>,<generic #2>>`, found `<generic integer #0>`
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ struct Foo { a: int, b: int }
|
|||
struct Bar { x: int }
|
||||
|
||||
static bar: Bar = Bar { x: 5 };
|
||||
static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types: expected `Foo` but found `Bar`
|
||||
static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types: expected `Foo`, found `Bar`
|
||||
static foo_i: Foo = Foo { a: 2, ..4 }; //~ ERROR mismatched types: expected `Foo`
|
||||
|
||||
fn main() {
|
||||
let b = Bar { x: 5 };
|
||||
let f = Foo { a: 2, ..b }; //~ ERROR mismatched types: expected `Foo` but found `Bar`
|
||||
let f = Foo { a: 2, ..b }; //~ ERROR mismatched types: expected `Foo`, found `Bar`
|
||||
let f_i = Foo { a: 2, ..4 }; //~ ERROR mismatched types: expected `Foo`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,25 +24,25 @@ type PairF<U> = Pair<f32,U>;
|
|||
|
||||
fn main() {
|
||||
let pt = PointF {
|
||||
//~^ ERROR expected f32 but found int
|
||||
//~^ ERROR expected f32, found int
|
||||
x: 1i,
|
||||
y: 2i,
|
||||
};
|
||||
|
||||
let pt2 = Point::<f32> {
|
||||
//~^ ERROR expected f32 but found int
|
||||
//~^ ERROR expected f32, found int
|
||||
x: 3i,
|
||||
y: 4i,
|
||||
};
|
||||
|
||||
let pair = PairF {
|
||||
//~^ ERROR expected f32 but found int
|
||||
//~^ ERROR expected f32, found int
|
||||
x: 5i,
|
||||
y: 6i,
|
||||
};
|
||||
|
||||
let pair2 = PairF::<int> {
|
||||
//~^ ERROR expected f32 but found int
|
||||
//~^ ERROR expected f32, found int
|
||||
x: 7i,
|
||||
y: 8i,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let (x, y) = (); //~ ERROR expected `()` but found tuple (types differ)
|
||||
let (x, y) = (); //~ ERROR expected `()`, found tuple (types differ)
|
||||
return x;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:mismatched types: expected `char` but found
|
||||
// error-pattern:mismatched types: expected `char`, found
|
||||
// Issue #876
|
||||
|
||||
#![no_implicit_prelude]
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct bar {
|
|||
|
||||
fn want_foo(f: foo) {}
|
||||
fn have_bar(b: bar) {
|
||||
want_foo(b); //~ ERROR (expected struct foo but found struct bar)
|
||||
want_foo(b); //~ ERROR (expected struct foo, found struct bar)
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ type bar = Gc<foo>;
|
|||
|
||||
fn want_foo(f: foo) {}
|
||||
fn have_bar(b: bar) {
|
||||
want_foo(b); //~ ERROR (expected struct foo but found Gc-ptr)
|
||||
want_foo(b); //~ ERROR (expected struct foo, found Gc-ptr)
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ impl Trait<&'static str> for Struct {
|
|||
|
||||
fn main() {
|
||||
let s: Box<Trait<int>> = box Struct { person: "Fred" };
|
||||
//~^ ERROR expected Trait<int>, but found Trait<&'static str>
|
||||
//~^^ ERROR expected Trait<int>, but found Trait<&'static str>
|
||||
//~^ ERROR expected Trait<int>, found Trait<&'static str>
|
||||
//~^^ ERROR expected Trait<int>, found Trait<&'static str>
|
||||
s.f(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ trait Mumbo {
|
|||
impl Mumbo for uint {
|
||||
// Cannot have a larger effect than the trait:
|
||||
unsafe fn jumbo(&self, x: Gc<uint>) { *self + *x; }
|
||||
//~^ ERROR expected normal fn but found unsafe fn
|
||||
//~^ ERROR expected normal fn, found unsafe fn
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ fn first((value, _): (int, f64)) -> int { value }
|
|||
|
||||
fn main() {
|
||||
let y = first ((1,2,3));
|
||||
//~^ ERROR expected a tuple with 2 elements but found one with 3 elements
|
||||
//~^ ERROR expected a tuple with 2 elements, found one with 3 elements
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ fn main() {
|
|||
|
||||
identity_u8(x); // after this, `x` is assumed to have type `u8`
|
||||
identity_u16(x);
|
||||
//~^ ERROR mismatched types: expected `u16` but found `u8`
|
||||
//~^ ERROR mismatched types: expected `u16`, found `u8`
|
||||
identity_u16(y);
|
||||
//~^ ERROR mismatched types: expected `u16` but found `i32`
|
||||
//~^ ERROR mismatched types: expected `u16`, found `i32`
|
||||
|
||||
let a = 3i;
|
||||
|
||||
|
|
@ -27,6 +27,6 @@ fn main() {
|
|||
|
||||
identity_i(a); // ok
|
||||
identity_u16(a);
|
||||
//~^ ERROR mismatched types: expected `u16` but found `int`
|
||||
//~^ ERROR mismatched types: expected `u16`, found `int`
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
// Test that we print out the names of type parameters correctly in
|
||||
// our error messages.
|
||||
|
||||
fn foo<Foo, Bar>(x: Foo) -> Bar { x } //~ ERROR expected `Bar` but found `Foo`
|
||||
fn foo<Foo, Bar>(x: Foo) -> Bar { x } //~ ERROR expected `Bar`, found `Foo`
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ trait Tr<T> {
|
|||
// these compile as if Self: Tr<U>, even tho only Self: Tr<Self or T>
|
||||
trait A: Tr<Self> {
|
||||
fn test<U>(u: U) -> Self {
|
||||
Tr::op(u) //~ ERROR expected Tr<U>, but found Tr<Self>
|
||||
Tr::op(u) //~ ERROR expected Tr<U>, found Tr<Self>
|
||||
}
|
||||
}
|
||||
trait B<T>: Tr<T> {
|
||||
fn test<U>(u: U) -> Self {
|
||||
Tr::op(u) //~ ERROR expected Tr<U>, but found Tr<T>
|
||||
Tr::op(u) //~ ERROR expected Tr<U>, found Tr<T>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ struct Foo<'a, T> {
|
|||
|
||||
pub fn main() {
|
||||
let c: Foo<_, _> = Foo { r: &5u };
|
||||
//~^ ERROR wrong number of type arguments: expected 1 but found 2
|
||||
//~^ ERROR wrong number of type arguments: expected 1, found 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ struct Foo<'a, T> {
|
|||
|
||||
pub fn main() {
|
||||
let c: Foo<_, uint> = Foo { r: &5 };
|
||||
//~^ ERROR wrong number of type arguments: expected 1 but found 2
|
||||
//~^ ERROR wrong number of type arguments: expected 1, found 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ pub fn main() {
|
|||
|
||||
fn test1() {
|
||||
let x: Foo<_> = Bar::<uint>;
|
||||
//~^ ERROR mismatched types: expected `Foo<<generic #0>>` but found `Bar<uint>`
|
||||
//~^ ERROR mismatched types: expected `Foo<<generic #0>>`, found `Bar<uint>`
|
||||
let y: Foo<uint> = x;
|
||||
}
|
||||
|
||||
fn test2() {
|
||||
let x: Foo<_> = Bar::<uint>;
|
||||
//~^ ERROR mismatched types: expected `Foo<<generic #0>>` but found `Bar<uint>`
|
||||
//~^ ERROR mismatched types: expected `Foo<<generic #0>>`, found `Bar<uint>`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// Test syntax checks for `type` keyword.
|
||||
|
||||
struct S1 for type; //~ ERROR expected `{`, `(`, or `;` after struct name but found `for`
|
||||
struct S1 for type; //~ ERROR expected `{`, `(`, or `;` after struct name, found `for`
|
||||
|
||||
pub fn main() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ fn main() {
|
|||
|
||||
let x: unsafe extern "C" fn(f: int, x: u8) = foo;
|
||||
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8)`
|
||||
// but found `unsafe extern "C" fn(int, u8, ...)`
|
||||
// (expected non-variadic fn but found variadic function)
|
||||
// , found `unsafe extern "C" fn(int, u8, ...)`
|
||||
// (expected non-variadic fn, found variadic function)
|
||||
|
||||
let y: unsafe extern "C" fn(f: int, x: u8, ...) = bar;
|
||||
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8, ...)`
|
||||
// but found `extern "C" extern fn(int, u8)`
|
||||
// (expected variadic fn but found non-variadic function)
|
||||
// , found `extern "C" extern fn(int, u8)`
|
||||
// (expected variadic fn, found non-variadic function)
|
||||
|
||||
foo(1, 2, 3f32); //~ ERROR: can't pass an f32 to variadic function, cast to c_double
|
||||
foo(1, 2, true); //~ ERROR: can't pass bool to variadic function, cast to c_int
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue