about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-12187-1.rs2
-rw-r--r--src/test/compile-fail/issue-12187-2.rs2
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_array.rs (renamed from src/test/ui/type-check/issue-38812-2.rs)2
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_array.stderr10
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_vec.rs (renamed from src/test/ui/type-check/issue-38812.rs)0
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_vec.stderr (renamed from src/test/ui/type-check/issue-38812.stderr)2
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.rs (renamed from src/test/compile-fail/E0101.rs)6
-rw-r--r--src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr12
-rw-r--r--src/test/ui/type-check/issue-22897.rs (renamed from src/test/compile-fail/issue-22897.rs)6
-rw-r--r--src/test/ui/type-check/issue-22897.stderr8
-rw-r--r--src/test/ui/type-check/issue-38812-2.stderr12
-rw-r--r--src/test/ui/type-check/unknown_type_for_closure.rs (renamed from src/test/compile-fail/E0102.rs)7
-rw-r--r--src/test/ui/type-check/unknown_type_for_closure.stderr8
13 files changed, 47 insertions, 30 deletions
diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/compile-fail/issue-12187-1.rs
index 6aeb9442c40..a79021d3cd5 100644
--- a/src/test/compile-fail/issue-12187-1.rs
+++ b/src/test/compile-fail/issue-12187-1.rs
@@ -16,5 +16,5 @@ fn main() {
     let &v = new();
     //~^ ERROR type annotations needed [E0282]
     //~| NOTE cannot infer type for `_`
-    //~| NOTE consider giving a type to pattern
+    //~| NOTE consider giving the pattern a type
 }
diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/compile-fail/issue-12187-2.rs
index d52ed06c408..38b3c5d4e9a 100644
--- a/src/test/compile-fail/issue-12187-2.rs
+++ b/src/test/compile-fail/issue-12187-2.rs
@@ -16,5 +16,5 @@ fn main() {
     let &v = new();
     //~^ ERROR type annotations needed [E0282]
     //~| NOTE cannot infer type for `_`
-    //~| NOTE consider giving a type to pattern
+    //~| NOTE consider giving the pattern a type
 }
diff --git a/src/test/ui/type-check/issue-38812-2.rs b/src/test/ui/type-check/cannot_infer_local_or_array.rs
index c476657d207..0b35a9c3dbe 100644
--- a/src/test/ui/type-check/issue-38812-2.rs
+++ b/src/test/ui/type-check/cannot_infer_local_or_array.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let (x,) = (vec![],);
+    let x = [];
 }
diff --git a/src/test/ui/type-check/cannot_infer_local_or_array.stderr b/src/test/ui/type-check/cannot_infer_local_or_array.stderr
new file mode 100644
index 00000000000..8c52bb5a1d3
--- /dev/null
+++ b/src/test/ui/type-check/cannot_infer_local_or_array.stderr
@@ -0,0 +1,10 @@
+error[E0282]: type annotations needed
+  --> $DIR/cannot_infer_local_or_array.rs:12:13
+   |
+12 |     let x = [];
+   |         -   ^^ cannot infer type for `_`
+   |         |
+   |         consider giving `x` a type
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-check/issue-38812.rs b/src/test/ui/type-check/cannot_infer_local_or_vec.rs
index a9943f75336..a9943f75336 100644
--- a/src/test/ui/type-check/issue-38812.rs
+++ b/src/test/ui/type-check/cannot_infer_local_or_vec.rs
diff --git a/src/test/ui/type-check/issue-38812.stderr b/src/test/ui/type-check/cannot_infer_local_or_vec.stderr
index 6365e761453..4788fad2088 100644
--- a/src/test/ui/type-check/issue-38812.stderr
+++ b/src/test/ui/type-check/cannot_infer_local_or_vec.stderr
@@ -1,5 +1,5 @@
 error[E0282]: type annotations needed
-  --> $DIR/issue-38812.rs:12:13
+  --> $DIR/cannot_infer_local_or_vec.rs:12:13
    |
 12 |     let x = vec![];
    |         -   ^^^^^^ cannot infer type for `T`
diff --git a/src/test/compile-fail/E0101.rs b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.rs
index 0005da048e4..8d32c1ff683 100644
--- a/src/test/compile-fail/E0101.rs
+++ b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.rs
@@ -1,4 +1,4 @@
-// Copyright 2016 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.
 //
@@ -9,7 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x = |_| {};
-    //~^ ERROR E0101
-    //~| NOTE cannot resolve type of expression
+    let (x, ) = (vec![], );
 }
diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr
new file mode 100644
index 00000000000..ccffadebe9e
--- /dev/null
+++ b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr
@@ -0,0 +1,12 @@
+error[E0282]: type annotations needed
+  --> $DIR/cannot_infer_local_or_vec_in_tuples.rs:12:18
+   |
+12 |     let (x, ) = (vec![], );
+   |         -----    ^^^^^^ cannot infer type for `T`
+   |         |
+   |         consider giving the pattern 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/compile-fail/issue-22897.rs b/src/test/ui/type-check/issue-22897.rs
index c6bbf2d4abc..296dc81a89b 100644
--- a/src/test/compile-fail/issue-22897.rs
+++ b/src/test/ui/type-check/issue-22897.rs
@@ -1,4 +1,4 @@
-// Copyright 2015 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.
 //
@@ -10,10 +10,6 @@
 
 fn main() { }
 
-// Before these errors would ICE as "cat_expr Errd" because the errors
-// were unknown when the bug was triggered.
-
 fn unconstrained_type() {
     [];
-    //~^ ERROR cannot determine a type for this expression: unconstrained type
 }
diff --git a/src/test/ui/type-check/issue-22897.stderr b/src/test/ui/type-check/issue-22897.stderr
new file mode 100644
index 00000000000..95684118851
--- /dev/null
+++ b/src/test/ui/type-check/issue-22897.stderr
@@ -0,0 +1,8 @@
+error[E0282]: type annotations needed
+  --> $DIR/issue-22897.rs:14:5
+   |
+14 |     [];
+   |     ^^ cannot infer type for `[_; 0]`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-check/issue-38812-2.stderr b/src/test/ui/type-check/issue-38812-2.stderr
deleted file mode 100644
index 156a6bdee99..00000000000
--- a/src/test/ui/type-check/issue-38812-2.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-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/compile-fail/E0102.rs b/src/test/ui/type-check/unknown_type_for_closure.rs
index 6a17ddebd1d..f1d357df12c 100644
--- a/src/test/compile-fail/E0102.rs
+++ b/src/test/ui/type-check/unknown_type_for_closure.rs
@@ -1,4 +1,4 @@
-// Copyright 2016 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.
 //
@@ -9,8 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x = [];
-    //~^ ERROR type annotations needed
-    //~| NOTE consider giving `x` a type
-    //~| NOTE cannot infer type for `_`
+    let x = |_| {    };
 }
diff --git a/src/test/ui/type-check/unknown_type_for_closure.stderr b/src/test/ui/type-check/unknown_type_for_closure.stderr
new file mode 100644
index 00000000000..afbd15ca486
--- /dev/null
+++ b/src/test/ui/type-check/unknown_type_for_closure.stderr
@@ -0,0 +1,8 @@
+error[E0282]: type annotations needed
+  --> $DIR/unknown_type_for_closure.rs:12:14
+   |
+12 |     let x = |_| {    };
+   |              ^ consider giving this closure parameter a type
+
+error: aborting due to previous error
+