diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-04-11 17:10:26 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-04-11 20:32:48 -0400 |
| commit | 1c138ed1c79cfac39c47cc4119a464f9b638a9c6 (patch) | |
| tree | 6c4f13c6b94f7e9ba16734bf695fe6c3f73e09e7 | |
| parent | bca56e82a1bbd775498257cc080f5ea27b214f49 (diff) | |
| download | rust-1c138ed1c79cfac39c47cc4119a464f9b638a9c6.tar.gz rust-1c138ed1c79cfac39c47cc4119a464f9b638a9c6.zip | |
update various test cases that generate slightly different output
For the most part, it seems to be better, but one side-effect is that I cannot seem to reproduce E0102 anymore.
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/E0102.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/destructure-trait-ref.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-12187-1.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-12187-2.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-7813.rs | 7 |
6 files changed, 11 insertions, 7 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index fb951fd20e5..2d72052f1e5 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1378,7 +1378,7 @@ E0102: r##" You hit this error because the compiler lacks the information to determine the type of this variable. Erroneous code example: -```compile_fail,E0102 +```compile_fail,E0282 // could be an array of anything let x = []; // error: cannot determine a type for this local variable ``` diff --git a/src/test/compile-fail/E0102.rs b/src/test/compile-fail/E0102.rs index 1d64798bb83..6a17ddebd1d 100644 --- a/src/test/compile-fail/E0102.rs +++ b/src/test/compile-fail/E0102.rs @@ -10,6 +10,7 @@ fn main() { let x = []; - //~^ ERROR E0102 - //~| NOTE cannot resolve type of variable + //~^ ERROR type annotations needed + //~| NOTE consider giving `x` a type + //~| NOTE cannot infer type for `_` } diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs index 835ec8e4a5e..09bd3a2fc57 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/compile-fail/destructure-trait-ref.rs @@ -35,7 +35,7 @@ fn main() { // n == m let &x = &1isize as &T; //~ ERROR type `&T` cannot be dereferenced let &&x = &(&1isize as &T); //~ ERROR type `&T` cannot be dereferenced - let box x = box 1isize as Box<T>; //~ ERROR `T: std::marker::Sized` is not satisfied + let box x = box 1isize as Box<T>; //~ ERROR type `std::boxed::Box<T>` cannot be dereferenced // n > m let &&x = &1isize as &T; diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/compile-fail/issue-12187-1.rs index 346fae11070..6aeb9442c40 100644 --- a/src/test/compile-fail/issue-12187-1.rs +++ b/src/test/compile-fail/issue-12187-1.rs @@ -16,4 +16,5 @@ fn main() { let &v = new(); //~^ ERROR type annotations needed [E0282] //~| NOTE cannot infer type for `_` + //~| NOTE consider giving a type to pattern } diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/compile-fail/issue-12187-2.rs index 848174d6fe1..d52ed06c408 100644 --- a/src/test/compile-fail/issue-12187-2.rs +++ b/src/test/compile-fail/issue-12187-2.rs @@ -16,4 +16,5 @@ fn main() { let &v = new(); //~^ ERROR type annotations needed [E0282] //~| NOTE cannot infer type for `_` + //~| NOTE consider giving a type to pattern } diff --git a/src/test/compile-fail/issue-7813.rs b/src/test/compile-fail/issue-7813.rs index 2551ed0208a..a5f001b785c 100644 --- a/src/test/compile-fail/issue-7813.rs +++ b/src/test/compile-fail/issue-7813.rs @@ -9,7 +9,8 @@ // except according to those terms. fn main() { - let v = &[]; //~ NOTE consider giving `v` a type - let it = v.iter(); //~ ERROR type annotations needed - //~^ NOTE cannot infer type for `_` + let v = &[]; //~ ERROR type annotations needed + //~| NOTE consider giving `v` a type + //~| NOTE cannot infer type for `_` + let it = v.iter(); } |
