]> git.lizzy.rs Git - rust.git/commitdiff
Add a new ui test and update existing ones
authorCengiz Can <cengizc@gmail.com>
Thu, 2 Feb 2017 21:35:31 +0000 (21:35 +0000)
committerCengiz Can <cengizc@gmail.com>
Sat, 4 Feb 2017 21:25:56 +0000 (16:25 -0500)
26 files changed:
src/test/compile-fail/issue-12187-1.rs
src/test/compile-fail/issue-12187-2.rs
src/test/compile-fail/issue-16966.rs
src/test/compile-fail/issue-17551.rs
src/test/compile-fail/issue-18159.rs
src/test/compile-fail/issue-23041.rs
src/test/compile-fail/issue-23046.rs
src/test/compile-fail/issue-24013.rs
src/test/compile-fail/issue-5062.rs
src/test/compile-fail/issue-6458-2.rs
src/test/compile-fail/issue-6458-3.rs
src/test/compile-fail/issue-6458.rs
src/test/compile-fail/issue-7813.rs
src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs
src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs
src/test/compile-fail/unconstrained-none.rs
src/test/compile-fail/unconstrained-ref.rs
src/test/compile-fail/vector-no-ann.rs
src/test/ui/codemap_tests/issue-38812-2.rs [new file with mode: 0644]
src/test/ui/codemap_tests/issue-38812-2.stderr [new file with mode: 0644]
src/test/ui/codemap_tests/issue-38812.rs [new file with mode: 0644]
src/test/ui/codemap_tests/issue-38812.stderr [new file with mode: 0644]
src/test/ui/codemap_tests/repair_span_std_macros.rs [deleted file]
src/test/ui/codemap_tests/repair_span_std_macros.stderr [deleted file]
src/test/ui/missing-items/missing-type-parameter.rs
src/test/ui/missing-items/missing-type-parameter.stderr

index 8f9b897eae22452dbb4905b974d2c1f31c535b3f..346fae11070e15b91e8ef1c8317bda7cf3287292 100644 (file)
@@ -14,7 +14,6 @@ fn new<T>() -> &'static T {
 
 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 `_`
 }
index 29ae04a3aaca679840bde14b9d00eb2a993fa887..848174d6fe1e057e1670c5e4d6e4e3161416e038 100644 (file)
@@ -14,7 +14,6 @@ fn new<'r, T>() -> &'r T {
 
 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 `_`
 }
index 508442fcb9453e4a0327aeb9c540f5cff5e3e736..ecf81c8af17f61018f4028cf2c0306ffa1a56876 100644 (file)
@@ -8,7 +8,7 @@
 // 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()
index 332d3fb3e2bedeb86db73c40b2ee29070abf5b18..b55863f0dda7af14a55354c721e5c97046a42531 100644 (file)
@@ -13,6 +13,6 @@
 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;
 }
index 7338d2cb41864d0b1f1a69b723856936076d2ee0..8991eded3d6b87d9be86a1b3c4d6d1bacdc46329 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x; //~ ERROR unable to fully infer type(s)
+    let x; //~ ERROR type annotations needed
 }
index f67d8affd30e7e30cb0c6556b938a0f150a762b5..4dfad4ee3c385d25b164a94393d4100806a18122 100644 (file)
@@ -14,6 +14,5 @@ fn main()
     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 `_`
 }
index c80923298bca91e4b4877a5f2b106bebb1378d4b..28109747b755747db465d323382a6aec6fda0822 100644 (file)
@@ -25,6 +25,6 @@ pub fn let_<'var, VAR, F: for<'v: 'var> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>>
 
 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)})};
 }
index edd876ed6639c253564c12ba7b8defb6574cf745..a7232781f6fbcfc710796b5b2de900f64157ccb4 100644 (file)
@@ -13,5 +13,5 @@ fn main() {
     let a = 1;
     let b = 2;
     unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
-    //~^ ERROR unable to fully infer type(s)
+    //~^ ERROR type annotations needed
 }
index e61ca92c78a10cd42dec2cc065d9873ee3224c27..ebfa4975d4d75c7ba77b1b444f20d243ac79e5f3 100644 (file)
@@ -9,4 +9,4 @@
 // except according to those terms.
 
 fn main() { format!("{:?}", None); }
-    //~^ ERROR unable to fully infer type(s) [E0282]
+    //~^ ERROR type annotations needed [E0282]
index 77eb8b3e7a95da381e22b0acd4de5aeb305e0a11..87cf2b3f740c1c7528a5b47b6c0a3bc311b7d345 100644 (file)
@@ -11,5 +11,5 @@
 fn main() {
     // Unconstrained type:
     format!("{:?}", None);
-    //~^ ERROR unable to fully infer type(s) [E0282]
+    //~^ ERROR type annotations needed [E0282]
 }
index a8ad8951c648130418f72b0ef8a73b6a7dc9f761..1503da2baa73d24af5146d0f41337c97c30eaef7 100644 (file)
@@ -12,7 +12,6 @@
 
 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`
 }
index 7d1b5cfffe4bfa08d0bc4c31bde9bd33bce14bb5..db4d4e76c11c9ae26a91b738678d6cb99786788d 100644 (file)
@@ -17,9 +17,8 @@ pub fn foo<State>(_: TypeWithState<State>) {}
 
 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() {
index c7510f215bed09a6abd7a22a732938400b4bde20..fdd89058fd3973498140ded97fe2f7b3d1c2d43c 100644 (file)
@@ -10,8 +10,7 @@
 
 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
 }
index eeecefd91aef7a08c8c1f93432141192d17ea261..9acf5a52166e07d5f5368516d6bc12eda7739a40 100644 (file)
@@ -32,7 +32,7 @@ fn foo(&self) -> isize {2}
 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();
 }
 
index 6ccd8f66a492c155ecfddd218d64a4e0444c6d85..2e115431c92c45698946c96b3ca2ec4610c3f897 100644 (file)
@@ -34,9 +34,8 @@ fn test<T,U>(_: T, _: U)
 
 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() {}
index 49818791d2fc51449ac03d624a88f71dfe8c1415..52ca91e62f8df56337f2c4f46c18af4fe60fc30d 100644 (file)
@@ -11,7 +11,6 @@
 // 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`
 }
index 53995af5b86700f8ca274801dd3fa2792ccb3528..6aaed789716a36d7847a4daf2a845c316b643625 100644 (file)
@@ -13,7 +13,6 @@ struct S<'a, T:'a> {
 }
 
 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`
 }
index d470f937190bbef1b4a3d6d0a69bd6e8e2b0f6c8..de229ded463f68570f5ed0a71866e9dbec44548a 100644 (file)
@@ -11,8 +11,7 @@
 
 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
 }
diff --git a/src/test/ui/codemap_tests/issue-38812-2.rs b/src/test/ui/codemap_tests/issue-38812-2.rs
new file mode 100644 (file)
index 0000000..c476657
--- /dev/null
@@ -0,0 +1,13 @@
+// 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![],);
+}
diff --git a/src/test/ui/codemap_tests/issue-38812-2.stderr b/src/test/ui/codemap_tests/issue-38812-2.stderr
new file mode 100644 (file)
index 0000000..156a6bd
--- /dev/null
@@ -0,0 +1,12 @@
+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
+
diff --git a/src/test/ui/codemap_tests/issue-38812.rs b/src/test/ui/codemap_tests/issue-38812.rs
new file mode 100644 (file)
index 0000000..a9943f7
--- /dev/null
@@ -0,0 +1,13 @@
+// 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![];
+}
diff --git a/src/test/ui/codemap_tests/issue-38812.stderr b/src/test/ui/codemap_tests/issue-38812.stderr
new file mode 100644 (file)
index 0000000..6365e76
--- /dev/null
@@ -0,0 +1,12 @@
+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
+
diff --git a/src/test/ui/codemap_tests/repair_span_std_macros.rs b/src/test/ui/codemap_tests/repair_span_std_macros.rs
deleted file mode 100644 (file)
index 3abc91d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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![];
-}
diff --git a/src/test/ui/codemap_tests/repair_span_std_macros.stderr b/src/test/ui/codemap_tests/repair_span_std_macros.stderr
deleted file mode 100644 (file)
index 13e4b24..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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
-
index 3671abd66246d864d6f38574adbc6ffce0ea48f5..79368587062e8b6fcecac948877846d5cb90a541 100644 (file)
@@ -1,4 +1,4 @@
-// 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.
 //
index 03e9f61610d84cce23740170ce2fc0b878b1394e..a16ae5538bf92d2038afae65670a6d6d909c7b1a 100644 (file)
@@ -1,10 +1,8 @@
-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