fn main() {
let &v = new();
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `_`
}
fn main() {
let &v = new();
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `_`
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// error-pattern:type annotations or generic parameter binding required
+// error-pattern:type annotations needed
fn main() {
panic!(
std::default::Default::default()
struct B<T>(marker::PhantomData<T>);
fn main() {
- let foo = B(marker::PhantomData); //~ ERROR unable to fully infer type(s)
+ let foo = B(marker::PhantomData); //~ ERROR type annotations needed
let closure = || foo;
}
// except according to those terms.
fn main() {
- let x; //~ ERROR unable to fully infer type(s)
+ let x; //~ ERROR type annotations needed
}
fn bar(x:i32) ->i32 { 3*x };
let b:Box<Any> = Box::new(bar as fn(_)->_);
b.downcast_ref::<fn(_)->_>(); //~ ERROR E0282
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding required
+ //~| NOTE cannot infer type for `_`
}
fn main() {
let ex = |x| {
- let_(add(x,x), |y| { //~ ERROR unable to fully infer type(s)
+ let_(add(x,x), |y| { //~ ERROR type annotations needed
let_(add(x, x), |x|x)})};
}
let a = 1;
let b = 2;
unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
- //~^ ERROR unable to fully infer type(s)
+ //~^ ERROR type annotations needed
}
// except according to those terms.
fn main() { format!("{:?}", None); }
- //~^ ERROR unable to fully infer type(s) [E0282]
+ //~^ ERROR type annotations needed [E0282]
fn main() {
// Unconstrained type:
format!("{:?}", None);
- //~^ ERROR unable to fully infer type(s) [E0282]
+ //~^ ERROR type annotations needed [E0282]
}
fn main() {
mem::transmute(0);
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `U`
}
pub fn bar() {
foo(TypeWithState(marker::PhantomData));
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `State`
}
fn main() {
fn main() {
let v = &[];
- let it = v.iter(); //~ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE annotating the type for the variable `it` would help
- //~| NOTE type annotations or generic parameter binding
+ let it = v.iter(); //~ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `T`
+ //~| NOTE consider giving `it` a type
}
fn m1() {
// we couldn't infer the type of the vector just based on calling foo()...
let mut x = Vec::new();
- //~^ ERROR unable to fully infer type(s) [E0282]
+ //~^ ERROR type annotations needed [E0282]
x.foo();
}
fn a() {
test(22, std::default::Default::default());
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `U`
}
fn main() {}
// Issue #5062
fn main() {
- None; //~ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ None; //~ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `T`
}
}
fn main() {
- S { o: &None }; //~ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE type annotations or generic parameter binding
+ S { o: &None }; //~ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `T`
}
fn main() {
let _foo = Vec::new();
- //~^ ERROR unable to fully infer type(s) [E0282]
- //~| NOTE cannot infer type
- //~| NOTE annotating the type for the variable `_foo` would help
- //~| NOTE type annotations or generic parameter binding
+ //~^ ERROR type annotations needed [E0282]
+ //~| NOTE cannot infer type for `T`
+ //~| NOTE consider giving `_foo` a type
}
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+ let (x,) = (vec![],);
+}
--- /dev/null
+error[E0282]: type annotations needed
+ --> $DIR/issue-38812-2.rs:12:17
+ |
+12 | let (x,) = (vec![],);
+ | ---- ^^^^^^ cannot infer type for `T`
+ | |
+ | consider giving a type to pattern
+ |
+ = note: this error originates in a macro outside of the current crate
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+ let x = vec![];
+}
--- /dev/null
+error[E0282]: type annotations needed
+ --> $DIR/issue-38812.rs:12:13
+ |
+12 | let x = vec![];
+ | - ^^^^^^ cannot infer type for `T`
+ | |
+ | consider giving `x` a type
+ |
+ = note: this error originates in a macro outside of the current crate
+
+error: aborting due to previous error
+
+++ /dev/null
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
- let x = vec![];
-}
+++ /dev/null
-error[E0282]: unable to fully infer type(s)
- --> $DIR/repair_span_std_macros.rs:12:13
- |
-12 | let x = vec![];
- | - ^^^^^^ cannot infer type
- | |
- | annotating the type for the variable `x` would help
- |
- = note: type annotations or generic parameter binding required
- = note: this error originates in a macro outside of the current crate
-
-error: aborting due to previous error
-
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
-error[E0282]: unable to fully infer type(s)
+error[E0282]: type annotations needed
--> $DIR/missing-type-parameter.rs:14:5
|
14 | foo();
- | ^^^ cannot infer type
- |
- = note: type annotations or generic parameter binding required
+ | ^^^ cannot infer type for `X`
error: aborting due to previous error