self.cur.next();
}
Some((_, other)) => {
- self.err(format!("expected `{}` but found `{}`",
+ self.err(format!("expected `{}`, found `{}`",
c,
other).as_slice());
}
let crate_num = match uint::parse_bytes(crate_part, 10u) {
Some(cn) => cn as ast::CrateNum,
- None => fail!("internal error: parse_def_id: crate number expected, but found {:?}",
+ None => fail!("internal error: parse_def_id: crate number expected, found {:?}",
crate_part)
};
let def_num = match uint::parse_bytes(def_part, 10u) {
Some(dn) => dn as ast::NodeId,
- None => fail!("internal error: parse_def_id: id expected, but found {:?}",
+ None => fail!("internal error: parse_def_id: id expected, found {:?}",
def_part)
};
ast::DefId { krate: crate_num, node: def_num }
// we need to create a new context, when we're
// - outside `unsafe` and found a `unsafe` block
// (normal case)
- // - inside `unsafe` but found an `unsafe` block
+ // - inside `unsafe`, found an `unsafe` block
// created internally to the compiler
//
// The second case is necessary to ensure that the
match *err {
terr_mismatch => "types differ".to_string(),
terr_fn_style_mismatch(values) => {
- format!("expected {} fn but found {} fn",
+ format!("expected {} fn, found {} fn",
values.expected.to_string(),
values.found.to_string())
}
terr_abi_mismatch(values) => {
- format!("expected {} fn but found {} fn",
+ format!("expected {} fn, found {} fn",
values.expected.to_string(),
values.found.to_string())
}
terr_onceness_mismatch(values) => {
- format!("expected {} fn but found {} fn",
+ format!("expected {} fn, found {} fn",
values.expected.to_string(),
values.found.to_string())
}
terr_ptr_mutability => "pointers differ in mutability".to_string(),
terr_ref_mutability => "references differ in mutability".to_string(),
terr_ty_param_size(values) => {
- format!("expected a type with {} type params \
- but found one with {} type params",
+ format!("expected a type with {} type params, \
+ found one with {} type params",
values.expected,
values.found)
}
terr_tuple_size(values) => {
- format!("expected a tuple with {} elements \
- but found one with {} elements",
+ format!("expected a tuple with {} elements, \
+ found one with {} elements",
values.expected,
values.found)
}
terr_record_size(values) => {
- format!("expected a record with {} fields \
- but found one with {} fields",
+ format!("expected a record with {} fields, \
+ found one with {} fields",
values.expected,
values.found)
}
"record elements differ in mutability".to_string()
}
terr_record_fields(values) => {
- format!("expected a record with field `{}` but found one \
+ format!("expected a record with field `{}`, found one \
with field `{}`",
token::get_ident(values.expected),
token::get_ident(values.found))
}
terr_regions_insufficiently_polymorphic(br, _) => {
format!("expected bound lifetime parameter {}, \
- but found concrete lifetime",
+ found concrete lifetime",
bound_region_ptr_to_string(cx, br))
}
terr_regions_overly_polymorphic(br, _) => {
format!("expected concrete lifetime, \
- but found bound lifetime parameter {}",
+ found bound lifetime parameter {}",
bound_region_ptr_to_string(cx, br))
}
terr_trait_stores_differ(_, ref values) => {
- format!("trait storage differs: expected `{}` but found `{}`",
+ format!("trait storage differs: expected `{}`, found `{}`",
trait_store_to_string(cx, (*values).expected),
trait_store_to_string(cx, (*values).found))
}
terr_sorts(values) => {
- format!("expected {} but found {}",
+ format!("expected {}, found {}",
ty_sort_string(cx, values.expected),
ty_sort_string(cx, values.found))
}
terr_traits(values) => {
- format!("expected trait `{}` but found trait `{}`",
+ format!("expected trait `{}`, found trait `{}`",
item_path_str(cx, values.expected),
item_path_str(cx, values.found))
}
terr_builtin_bounds(values) => {
if values.expected.is_empty() {
- format!("expected no bounds but found `{}`",
+ format!("expected no bounds, found `{}`",
values.found.user_string(cx))
} else if values.found.is_empty() {
- format!("expected bounds `{}` but found no bounds",
+ format!("expected bounds `{}`, found no bounds",
values.expected.user_string(cx))
} else {
- format!("expected bounds `{}` but found bounds `{}`",
+ format!("expected bounds `{}`, found bounds `{}`",
values.expected.user_string(cx),
values.found.user_string(cx))
}
}
terr_integer_as_char => {
- "expected an integral type but found `char`".to_string()
+ "expected an integral type, found `char`".to_string()
}
terr_int_mismatch(ref values) => {
- format!("expected `{}` but found `{}`",
+ format!("expected `{}`, found `{}`",
values.expected.to_string(),
values.found.to_string())
}
terr_float_mismatch(ref values) => {
- format!("expected `{}` but found `{}`",
+ format!("expected `{}`, found `{}`",
values.expected.to_string(),
values.found.to_string())
}
terr_variadic_mismatch(ref values) => {
- format!("expected {} fn but found {} function",
+ format!("expected {} fn, found {} function",
if values.expected { "variadic" } else { "non-variadic" },
if values.found { "variadic" } else { "non-variadic" })
}
const_eval::const_int(count) => if count < 0 {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found negative integer");
+ repeat count, found negative integer");
return 0;
} else {
return count as uint
const_eval::const_float(count) => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found float");
+ repeat count, found float");
return count as uint;
}
const_eval::const_str(_) => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found string");
+ repeat count, found string");
return 0;
}
const_eval::const_bool(_) => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found boolean");
+ repeat count, found boolean");
return 0;
}
const_eval::const_binary(_) => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found binary array");
+ repeat count, found binary array");
return 0;
}
const_eval::const_nil => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected positive integer for \
- repeat count but found ()");
+ repeat count, found ()");
return 0;
}
},
Err(..) => {
tcx.ty_ctxt().sess.span_err(count_expr.span,
- "expected constant integer for repeat count \
- but found variable");
+ "expected constant integer for repeat count, \
+ found variable");
return 0;
}
}
if supplied_num_region_params != 0 || anon_regions.is_err() {
span_err!(tcx.sess, path.span, E0107,
- "wrong number of lifetime parameters: expected {} but found {}",
+ "wrong number of lifetime parameters: expected {}, found {}",
expected_num_region_params, supplied_num_region_params);
}
"expected"
};
this.tcx().sess.span_fatal(path.span,
- format!("wrong number of type arguments: {} {} but found {}",
+ format!("wrong number of type arguments: {} {}, found {}",
expected,
required_ty_param_count,
supplied_ty_param_count).as_slice());
"expected"
};
this.tcx().sess.span_fatal(path.span,
- format!("wrong number of type arguments: {} {} but found {}",
+ format!("wrong number of type arguments: {} {}, found {}",
expected,
formal_ty_param_count,
supplied_ty_param_count).as_slice());
fcx.infcx().type_error_message_str_with_expected(pat.span,
|expected, actual| {
expected.map_or("".to_string(), |e| {
- format!("mismatched types: expected `{}` but found {}",
+ format!("mismatched types: expected `{}`, found {}",
e, actual)
})},
Some(expected),
|expected, actual| {
expected.map_or("".to_string(),
|e| {
- format!("mismatched types: expected `{}` but found {}",
+ format!("mismatched types: expected `{}`, found {}",
e, actual)
})
},
Some(&def::DefTy(..)) => {
let name = pprust::path_to_string(path);
span_err!(tcx.sess, span, E0028,
- "mismatched types: expected `{}` but found `{}`",
+ "mismatched types: expected `{}`, found `{}`",
fcx.infcx().ty_to_string(expected), name);
}
_ => {
expected.map_or("".to_string(),
|e| {
format!("mismatched types: expected \
- `{}` but found {}", e, actual)
+ `{}`, found {}", e, actual)
})},
Some(expected),
"a structure pattern".to_string(),
|expected,
actual| {
expected.map_or("".to_string(), |e| {
- format!("mismatched types: expected `{}` \
- but found {}", e, actual)
+ format!("mismatched types: expected `{}`, \
+ found {}", e, actual)
}
)},
Some(expected),
|expected, actual| {
expected.map_or("".to_string(),
|e| {
- format!("mismatched types: expected `{}` but found {}",
+ format!("mismatched types: expected `{}`, found {}",
e, actual)
})
},
span,
|expected, actual| {
expected.map_or("".to_string(), |e| {
- format!("mismatched types: expected `{}` but found {}",
+ format!("mismatched types: expected `{}`, found {}",
e, actual)
})
},
ty::ty_closure(box ty::ClosureTy {sig: ref sig, ..}) => sig,
_ => {
fcx.type_error_message(call_expr.span, |actual| {
- format!("expected function but found `{}`", actual)
+ format!("expected function, found `{}`", actual)
}, fn_ty, None);
&error_fn_sig
}
pub fn require_uint(fcx: &FnCtxt, sp: Span, t: ty::t) {
if !type_is_uint(fcx, sp, t) {
fcx.type_error_message(sp, |actual| {
- format!("mismatched types: expected `uint` type but found `{}`",
+ format!("mismatched types: expected `uint` type, found `{}`",
actual)
}, t, None);
}
pub fn require_integral(fcx: &FnCtxt, sp: Span, t: ty::t) {
if !type_is_integral(fcx, sp, t) {
fcx.type_error_message(sp, |actual| {
- format!("mismatched types: expected integral type but found `{}`",
+ format!("mismatched types: expected integral type, found `{}`",
actual)
}, t, None);
}
def::DefTy(_) |
def::DefPrimTy(_) |
def::DefTyParam(..)=> {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found type");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found type");
}
def::DefMod(..) | def::DefForeignMod(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found module");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found module");
}
def::DefUse(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found use");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found use");
}
def::DefRegion(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found region");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found region");
}
def::DefTyParamBinder(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found type parameter");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found type parameter");
}
def::DefLabel(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found label");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found label");
}
def::DefSelfTy(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found self ty");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found self ty");
}
def::DefMethod(..) => {
- fcx.ccx.tcx.sess.span_bug(sp, "expected value but found method");
+ fcx.ccx.tcx.sess.span_bug(sp, "expected value, found method");
}
}
}
} else if i == type_count {
span_err!(fcx.tcx().sess, typ.span, E0087,
"too many type parameters provided: \
- expected at most {} parameter(s) \
- but found {} parameter(s)",
+ expected at most {} parameter(s), \
+ found {} parameter(s)",
type_count, segment.types.len());
substs.types.truncate(space, 0);
}
} else if i == region_count {
span_err!(fcx.tcx().sess, lifetime.span, E0088,
"too many lifetime parameters provided: \
- expected {} parameter(s) but found {} parameter(s)",
+ expected {} parameter(s), found {} parameter(s)",
region_count,
segment.lifetimes.len());
substs.mut_regions().truncate(space, 0);
if desired.len() != required_len { "at least " } else { "" };
span_err!(fcx.tcx().sess, span, E0089,
"too few type parameters provided: expected {}{} parameter(s) \
- but found {} parameter(s)",
+ , found {} parameter(s)",
qualifier, required_len, provided_len);
substs.types.replace(space,
Vec::from_elem(desired.len(), ty::mk_err()));
// Otherwise, too few were provided. Report an error and then
// use inference variables.
span_err!(fcx.tcx().sess, span, E0090,
- "too few lifetime parameters provided: expected {} parameter(s) \
- but found {} parameter(s)",
+ "too few lifetime parameters provided: expected {} parameter(s), \
+ found {} parameter(s)",
desired.len(), provided_len);
substs.mut_regions().replace(
!ty::trait_ref_contains_error(&r_exp_trait_ref)
{
let tcx = vcx.tcx();
- span_err!(tcx.sess, span, E0095, "expected {}, but found {} ({})",
+ span_err!(tcx.sess, span, E0095, "expected {}, found {} ({})",
ppaux::trait_ref_to_string(tcx, &r_exp_trait_ref),
ppaux::trait_ref_to_string(tcx, &r_act_trait_ref),
ty::type_err_to_str(tcx, err));
fn values_str(&self, values: &ValuePairs) -> Option<String> {
/*!
- * Returns a string of the form "expected `{}` but found `{}`",
+ * Returns a string of the form "expected `{}`, found `{}`",
* or None if this is a derived error.
*/
match *values {
return None;
}
- Some(format!("expected `{}` but found `{}`",
+ Some(format!("expected `{}`, found `{}`",
expected.user_string(self.tcx),
found.user_string(self.tcx)))
}
_ => {
// if I leave out : String, it infers &str and complains
|actual: String| {
- format!("mismatched types: expected `{}` but found `{}`",
+ format!("mismatched types: expected `{}`, found `{}`",
self.ty_to_string(resolved_expected),
actual)
}
clobs.push(clob);
if OPTIONS.iter().any(|opt| s.equiv(opt)) {
- cx.span_warn(p.last_span, "expected a clobber, but found an option");
+ cx.span_warn(p.last_span, "expected a clobber, found an option");
}
}
}
_ => {
ecx.span_err(p.span,
- format!("expected ident for named argument, but found `{}`",
+ format!("expected ident for named argument, found `{}`",
p.this_token_to_string()).as_slice());
return (invocation, None);
}
}
_ => {
let token_str = self.this_token_to_string();
- self.fatal(format!("expected `#` but found `{}`",
+ self.fatal(format!("expected `#`, found `{}`",
token_str).as_slice());
}
};
} else {
let token_str = Parser::token_to_string(t);
let this_token_str = self.this_token_to_string();
- self.fatal(format!("expected `{}` but found `{}`",
+ self.fatal(format!("expected `{}`, found `{}`",
token_str,
this_token_str).as_slice())
}
let actual = self.this_token_to_string();
self.fatal(
(if expected.len() != 1 {
- (format!("expected one of `{}` but found `{}`",
+ (format!("expected one of `{}`, found `{}`",
expect,
actual))
} else {
- (format!("expected `{}` but found `{}`",
+ (format!("expected `{}`, found `{}`",
expect,
actual))
}).as_slice()
_ => {
let token_str = p.this_token_to_string();
- p.fatal((format!("expected `;` or `{{` but found `{}`",
+ p.fatal((format!("expected `;` or `{{`, found `{}`",
token_str)).as_slice())
}
}
""
};
let tok_str = self.this_token_to_string();
- self.fatal(format!("expected {}`(` or `{{`, but found `{}`",
+ self.fatal(format!("expected {}`(` or `{{`, found `{}`",
ident_str,
tok_str).as_slice())
}
},
_ => {
let token_str = self.this_token_to_string();
- self.fatal(format!("expected `self` but found `{}`",
+ self.fatal(format!("expected `self`, found `{}`",
token_str).as_slice())
}
}
} else {
let token_str = self.this_token_to_string();
self.fatal(format!("expected `{}`, `(`, or `;` after struct \
- name but found `{}`", "{",
+ name, found `{}`", "{",
token_str).as_slice())
}
let span = self.span;
let token_str = self.this_token_to_string();
self.span_fatal(span,
- format!("expected `,`, or `}}` but found `{}`",
+ format!("expected `,`, or `}}`, found `{}`",
token_str).as_slice())
}
}
}
_ => {
let token_str = self.this_token_to_string();
- self.fatal(format!("expected item but found `{}`",
+ self.fatal(format!("expected item, found `{}`",
token_str).as_slice())
}
}
let span = self.span;
let token_str = self.this_token_to_string();
self.span_fatal(span,
- format!("expected `{}` or `fn` but found `{}`", "{",
+ format!("expected `{}` or `fn`, found `{}`", "{",
token_str).as_slice());
}
// Check magic number
let magic = try!(file.read_le_u16());
if magic != 0x011A {
- return Err(format!("invalid magic number: expected {:x} but found {:x}",
+ return Err(format!("invalid magic number: expected {:x}, found {:x}",
0x011Au, magic as uint));
}
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);
}
fn bad_bang(i: uint) -> ! {
return 7u;
- //~^ ERROR expected `!` but found `uint`
+ //~^ ERROR expected `!`, found `uint`
}
fn main() { bad_bang(5u); }
fn bad_bang(i: uint) -> ! {
if i < 0u { } else { fail!(); }
- //~^ ERROR expected `!` but found `()`
+ //~^ ERROR expected `!`, found `()`
}
fn main() { bad_bang(5u); }
// 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); }
// except according to those terms.
fn f() -> ! {
- 3i //~ ERROR expected `!` but found `int`
+ 3i //~ ERROR expected `!`, found `int`
}
fn main() { }
// 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 {
// 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;
// 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 {
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() {}
// 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>`
// 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 `;`
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() {}
// 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`
// 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 `{`
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() {
fn bar(x: T1) -> T2 {
return x;
- //~^ ERROR mismatched types: expected `T2` but found `T1`
+ //~^ ERROR mismatched types: expected `T2`, found `T1`
}
fn main() {
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
}
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
}
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 `()`
}
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`
}
// 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;
#![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,
}
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
}
extern fn bar() {}
fn main() { f(bar) }
-//~^ ERROR: expected `fn()` but found `extern "C" fn()`
+//~^ ERROR: expected `fn()`, found `extern "C" fn()`
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
fn main() {
let test = box Test { func: proc() {} };
- //~^ ERROR: expected `||` but found `proc()`
+ //~^ ERROR: expected `||`, found `proc()`
}
//! 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) { }
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)
};
}
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)
}
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]`
}
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);
}
}
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
}
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!()
}
}
// 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",
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() {
fn main()
{
let x = 3
-} //~ ERROR: expected `;` but found `}`
+} //~ ERROR: expected `;`, found `}`
// 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
}
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>>`
}
}
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)
}
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)
}
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`
}
fn main() {
match S(Left(5)) {
- Right(_) => {} //~ ERROR mismatched types: expected `S` but found `Either
+ Right(_) => {} //~ ERROR mismatched types: expected `S`, found `Either
_ => {}
}
}
// 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() {}
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() {}
fn foo(x: Whatever) {
match x {
Some(field) => field.access(),
- //~^ ERROR: mismatched types: expected `Whatever` but found
+ //~^ ERROR: mismatched types: expected `Whatever`, found
}
}
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() {}
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`)
}
loop {
break;
}
- return 42i; //~ ERROR expected `!` but found `int`
+ return 42i; //~ ERROR expected `!`, found `int`
}
fn main() {
// except according to those terms.
fn main() {
- foo! bar < //~ ERROR expected `(` or `{`, but found `<`
+ foo! bar < //~ ERROR expected `(` or `{`, found `<`
}
fn main() {
match (S { a: 1 }) {
- C(_) => (), //~ ERROR mismatched types: expected `S` but found `E`
+ C(_) => (), //~ ERROR mismatched types: expected `S`, found `E`
_ => ()
}
}
fn main() {
match () {
- [()] => { } //~ ERROR mismatched types: expected `()` but found a vector pattern
+ [()] => { } //~ ERROR mismatched types: expected `()`, found a vector pattern
}
}
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() }
}
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 `{`
}
// 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>`
}
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
}
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
}
}
// 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 `)`
}
_ => ()
}
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`
}
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`
}
static s: &'static str =
r#"
- "## //~ ERROR expected `;` but found `#`
+ "## //~ ERROR expected `;`, found `#`
;
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
}
}
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
}
}
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/&`
}
}
}
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 {
// 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 `/`
// 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`
// 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 `=`
struct s {
let foo: (),
//~^ ERROR found `let` in ident position
- //~^^ ERROR expected `:` but found `foo`
+ //~^^ ERROR expected `:`, found `foo`
}
struct s {
bar: ();
- //~^ ERROR expected `,`, or `}` but found `;`
+ //~^ ERROR expected `,`, or `}`, found `;`
}
// 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 `*`
// 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`
// except according to those terms.
fn f() {
- let x: fn~() = || (); //~ ERROR expected `(` but found `~`
+ let x: fn~() = || (); //~ ERROR expected `(`, found `~`
}
fn removed_moves() {
let mut x = 0;
let y <- x;
- //~^ ERROR expected `;` but found `<-`
+ //~^ ERROR expected `;`, found `<-`
}
let mut x = 0;
let y = 0;
y <- x;
- //~^ ERROR expected one of `;`, `}` but found `<-`
+ //~^ ERROR expected one of `;`, `}`, found `<-`
}
fn f() {
let v = [mut 1, 2, 3, 4];
//~^ ERROR found `mut` in ident position
- //~^^ ERROR expected `]` but found `1`
+ //~^^ ERROR expected `]`, found `1`
}
type v = [mut int];
//~^ ERROR found `mut` in ident position
- //~^^ ERROR expected `]` but found `int`
+ //~^^ ERROR expected `]`, found `int`
// 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 `/`
fn f() {
let a_box = box mut 42;
//~^ ERROR found `mut` in ident position
- //~^^ ERROR expected `;` but found `42`
+ //~^^ ERROR expected `;`, found `42`
}
type mut_box = Box<mut int>;
//~^ ERROR found `mut` in ident position
- //~^^ ERROR expected `,` but found `int`
+ //~^^ ERROR expected `,`, found `int`
let a = S { foo: (), bar: () };
let b = S { foo: () with a };
- //~^ ERROR expected one of `,`, `}` but found `with`
+ //~^ ERROR expected one of `,`, `}`, found `with`
}
let a = S { foo: (), bar: () };
let b = S { foo: (), with a };
- //~^ ERROR expected `:` but found `a`
+ //~^ ERROR expected `:`, found `a`
}
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
}
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>`
}
}
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`
}
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,
};
// 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;
}
// 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]
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() {}
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() {}
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);
}
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() {}
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
}
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;
identity_i(a); // ok
identity_u16(a);
- //~^ ERROR mismatched types: expected `u16` but found `int`
+ //~^ ERROR mismatched types: expected `u16`, found `int`
}
// 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() {}
// 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>
}
}
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
}
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
}
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>`
}
// 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() {
}
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
// Expecting ref in input signature
impl Mul<f64, Vec1> for Vec1 {
fn mul(&self, s: f64) -> Vec1 {
- //~^ ERROR: method `mul` has an incompatible type for trait: expected &-ptr but found f64
+ //~^ ERROR: method `mul` has an incompatible type for trait: expected &-ptr, found f64
Vec1 {
x: self.x * s
}
// Wrong type parameter ordering
impl Mul<Vec2, f64> for Vec2 {
fn mul(&self, s: f64) -> Vec2 {
- //~^ ERROR: method `mul` has an incompatible type for trait: expected &-ptr but found f64
+ //~^ ERROR: method `mul` has an incompatible type for trait: expected &-ptr, found f64
Vec2 {
x: self.x * s,
y: self.y * s
// Unexpected return type
impl Mul<f64, i32> for Vec3 {
fn mul(&self, s: &f64) -> f64 {
- //~^ ERROR: method `mul` has an incompatible type for trait: expected i32 but found f64
+ //~^ ERROR: method `mul` has an incompatible type for trait: expected i32, found f64
*s
}
}
// positive test so that this test will be updated when the
// compiler changes.
- assert!(err.as_slice().contains("expected item but found"))
+ assert!(err.as_slice().contains("expected item, found"))
}
}
(label, bool_value(false))
}
_ => {
- println!("Expected dict for {} interfaces but found {:?}", managed_ip, data);
+ println!("Expected dict for {} interfaces, found {:?}", managed_ip, data);
("gnos:missing-interface".to_string(), bool_value(true))
}
}
}
_ =>
{
- println!("Expected list for {} interfaces but found {:?}", managed_ip,
+ println!("Expected list for {} interfaces, found {:?}", managed_ip,
device.get(&"interfaces".to_string()));
Vec::new()
}