Skip to content

Commit

Permalink
test: Update expected compile-fail message for E0282
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuda committed May 5, 2015
1 parent 414dfb1 commit 4b8098b
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-12187-1.rs
@@ -1,4 +1,4 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -14,5 +14,5 @@ fn new<T>() -> &'static T {

fn main() {
let &v = new();
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-12187-2.rs
@@ -1,4 +1,4 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -14,5 +14,5 @@ fn new<'r, T>() -> &'r T {

fn main() {
let &v = new();
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-5062.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -9,4 +9,4 @@
// except according to those terms.

fn main() { format!("{:?}", None); }
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-6458-2.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -11,5 +11,5 @@
fn main() {
// Unconstrained type:
format!("{:?}", None);
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-6458-3.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -12,5 +12,5 @@ use std::mem;

fn main() {
mem::transmute(0);
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-6458-4.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

fn foo(b: bool) -> Result<bool,String> {
Err("bar".to_string());
//~^ ERROR type annotations required
//~^ ERROR type annotations or generic parameter binding required
}

fn main() {
Expand Down
5 changes: 3 additions & 2 deletions src/test/compile-fail/issue-6458.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -16,7 +16,8 @@ pub struct MyState;
pub fn foo<State>(_: TypeWithState<State>) {}

pub fn bar() {
foo(TypeWithState(marker::PhantomData)); //~ ERROR type annotations required
foo(TypeWithState(marker::PhantomData));
//~^ ERROR type annotations or generic parameter binding required
}

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-7813.rs
@@ -1,4 +1,4 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,5 +10,5 @@

fn main() {
let v = &[];
let it = v.iter(); //~ ERROR type annotations required
let it = v.iter(); //~ ERROR type annotations or generic parameter binding required
}
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -31,7 +31,8 @@ impl foo for Vec<isize> {

fn m1() {
// we couldn't infer the type of the vector just based on calling foo()...
let mut x = Vec::new(); //~ ERROR type annotations required
let mut x = Vec::new();
//~^ ERROR type annotations or generic parameter binding required
x.foo();
}

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -33,7 +33,8 @@ where T : Convert<U>
}

fn a() {
test(22, std::default::Default::default()); //~ ERROR type annotations required
test(22, std::default::Default::default());
//~^ ERROR type annotations or generic parameter binding required
}

fn main() {}
4 changes: 2 additions & 2 deletions src/test/compile-fail/unconstrained-none.rs
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -11,5 +11,5 @@
// Issue #5062

fn main() {
None; //~ ERROR type annotations required
None; //~ ERROR type annotations or generic parameter binding required
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/unconstrained-ref.rs
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -13,5 +13,5 @@ struct S<'a, T:'a> {
}

fn main() {
S { o: &None }; //~ ERROR type annotations required
S { o: &None }; //~ ERROR type annotations or generic parameter binding required
}
5 changes: 3 additions & 2 deletions src/test/compile-fail/vector-no-ann.rs
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,5 +10,6 @@


fn main() {
let _foo = Vec::new(); //~ ERROR type annotations required
let _foo = Vec::new();
//~^ ERROR type annotations or generic parameter binding required
}

0 comments on commit 4b8098b

Please sign in to comment.