about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorcsmoe <35686186+csmoe@users.noreply.github.com>2018-02-14 11:06:08 +0800
committercsmoe <35686186+csmoe@users.noreply.github.com>2018-02-14 11:06:08 +0800
commit20dcc72127b53e1b7388f430f7ed26144fe5dcf4 (patch)
treea12ec4a162a224c9c28a67a59e97992087e6160c /src
parent4d2d3fc5dadf894a8ad709a5860a549f2c0b1032 (diff)
downloadrust-20dcc72127b53e1b7388f430f7ed26144fe5dcf4.tar.gz
rust-20dcc72127b53e1b7388f430f7ed26144fe5dcf4.zip
inform type annotations
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/mod.rs4
-rw-r--r--src/librustc_typeck/diagnostics.rs3
-rw-r--r--src/test/compile-fail/epoch-raw-pointer-method-2015.rs2
-rw-r--r--src/test/compile-fail/issue-15965.rs2
-rw-r--r--src/test/compile-fail/issue-2151.rs2
-rw-r--r--src/test/compile-fail/match-vec-mismatch.rs2
-rw-r--r--src/test/compile-fail/pat-tuple-bad-type.rs2
-rw-r--r--src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs2
-rw-r--r--src/test/ui/error-codes/E0619.rs19
-rw-r--r--src/test/ui/error-codes/E0619.stderr8
-rw-r--r--src/test/ui/inference-variable-behind-raw-pointer.stderr2
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.rs4
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.stderr6
13 files changed, 15 insertions, 43 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 165b499cc62..e760636230d 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -5086,9 +5086,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
             // If not, error.
             if alternative.is_ty_var() || alternative.references_error() {
                 if !self.is_tainted_by_errors() {
-                    type_error_struct!(self.tcx.sess, sp, ty, E0619,
-                                       "the type of this value must be known in this context")
-                        .emit();
+                    self.need_type_info((**self).body_id, sp, ty);
                 }
                 self.demand_suptype(sp, self.tcx.types.err, ty);
                 ty = self.tcx.types.err;
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index f59948e9fc4..1c0e084832e 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -4368,12 +4368,13 @@ i_am_a_function();
 "##,
 
 E0619: r##"
+#### Note: this error code is no longer emitted by the compiler.
 The type-checker needed to know the type of an expression, but that type had not
 yet been inferred.
 
 Erroneous code example:
 
-```compile_fail,E0619
+```compile_fail
 let mut x = vec![];
 match x.pop() {
     Some(v) => {
diff --git a/src/test/compile-fail/epoch-raw-pointer-method-2015.rs b/src/test/compile-fail/epoch-raw-pointer-method-2015.rs
index a71db040b50..6aa83a38b7e 100644
--- a/src/test/compile-fail/epoch-raw-pointer-method-2015.rs
+++ b/src/test/compile-fail/epoch-raw-pointer-method-2015.rs
@@ -18,6 +18,6 @@ fn main() {
     let x = 0;
     let y = &x as *const _;
     let _ = y.is_null();
-    //~^ error: the type of this value must be known in this context [tyvar_behind_raw_pointer]
+    //~^ error: type annotations needed [tyvar_behind_raw_pointer]
     //~^^ warning: this was previously accepted
 }
diff --git a/src/test/compile-fail/issue-15965.rs b/src/test/compile-fail/issue-15965.rs
index 08b896f387b..76ba5a0f4b3 100644
--- a/src/test/compile-fail/issue-15965.rs
+++ b/src/test/compile-fail/issue-15965.rs
@@ -11,7 +11,7 @@
 fn main() {
     return
         { return () }
-//~^ ERROR the type of this value must be known in this context
+//~^ ERROR type annotations needed [E0282]
     ()
     ;
 }
diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs
index fbd8f9163b5..3cf971f3f8d 100644
--- a/src/test/compile-fail/issue-2151.rs
+++ b/src/test/compile-fail/issue-2151.rs
@@ -10,5 +10,5 @@
 
 fn main() {
     let x = panic!();
-    x.clone(); //~ ERROR the type of this value must be known in this context
+    x.clone(); //~ ERROR type annotations needed
 }
diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/compile-fail/match-vec-mismatch.rs
index fed68da0068..998c1197995 100644
--- a/src/test/compile-fail/match-vec-mismatch.rs
+++ b/src/test/compile-fail/match-vec-mismatch.rs
@@ -43,6 +43,6 @@ fn main() {
 fn another_fn_to_avoid_suppression() {
     match Default::default()
     {
-        [] => {}  //~ ERROR the type of this value
+        [] => {}  //~ ERROR type annotations needed
     };
 }
diff --git a/src/test/compile-fail/pat-tuple-bad-type.rs b/src/test/compile-fail/pat-tuple-bad-type.rs
index fd4ab5d2531..251e7b47dcc 100644
--- a/src/test/compile-fail/pat-tuple-bad-type.rs
+++ b/src/test/compile-fail/pat-tuple-bad-type.rs
@@ -12,7 +12,7 @@ fn main() {
     let x;
 
     match x {
-        (..) => {} //~ ERROR the type of this value must be known in this context
+        (..) => {} //~ ERROR type annotations needed
         _ => {}
     }
 
diff --git a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs b/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs
index 12b48b2a6c8..8f5bf827fcf 100644
--- a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs
+++ b/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs
@@ -24,7 +24,7 @@ fn a() {
                 match closure0.take() {
                     Some(c) => {
                         return c();
-                        //~^ ERROR the type of this value must be known in this context
+                        //~^ ERROR type annotations needed
                     }
                     None => { }
                 }
diff --git a/src/test/ui/error-codes/E0619.rs b/src/test/ui/error-codes/E0619.rs
deleted file mode 100644
index a5a5ff7218d..00000000000
--- a/src/test/ui/error-codes/E0619.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// 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;
-
-    match x {
-        (..) => {} //~ ERROR E0619
-        _ => {}
-    }
-}
-
diff --git a/src/test/ui/error-codes/E0619.stderr b/src/test/ui/error-codes/E0619.stderr
deleted file mode 100644
index cec336cfcec..00000000000
--- a/src/test/ui/error-codes/E0619.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error[E0619]: the type of this value must be known in this context
-  --> $DIR/E0619.rs:15:9
-   |
-15 |         (..) => {} //~ ERROR E0619
-   |         ^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/inference-variable-behind-raw-pointer.stderr b/src/test/ui/inference-variable-behind-raw-pointer.stderr
index d0ee55c092b..bb1d921f1c6 100644
--- a/src/test/ui/inference-variable-behind-raw-pointer.stderr
+++ b/src/test/ui/inference-variable-behind-raw-pointer.stderr
@@ -1,4 +1,4 @@
-warning: the type of this value must be known in this context
+warning: type annotations needed
   --> $DIR/inference-variable-behind-raw-pointer.rs:18:13
    |
 18 |     if data.is_null() {}
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.rs b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
index d9cdd99c245..975c81955e0 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.rs
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
@@ -15,11 +15,11 @@
 fn shines_a_beacon_through_the_darkness() {
     let x: Option<_> = None;
     x.unwrap().method_that_could_exist_on_some_type();
-    //~^ ERROR 17:5: 17:15: the type of this value must be known in this context
+    //~^ ERROR 17:5: 17:15: type annotations needed
 }
 
 fn courier_to_des_moines_and_points_west(data: &[u32]) -> String {
-    data.iter() //~ ERROR 22:5: 23:20: the type of this value must be known in this context
+    data.iter() //~ ERROR 22:5: 23:20: type annotations needed
         .sum::<_>()
         .to_string()
 }
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
index ed756cdc553..2a85e1f1c45 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
@@ -1,13 +1,13 @@
-error[E0619]: the type of this value must be known in this context
+error[E0282]: type annotations needed
   --> $DIR/issue-42234-unknown-receiver-type.rs:17:5
    |
 17 |     x.unwrap().method_that_could_exist_on_some_type();
    |     ^^^^^^^^^^
 
-error[E0619]: the type of this value must be known in this context
+error[E0282]: type annotations needed
   --> $DIR/issue-42234-unknown-receiver-type.rs:22:5
    |
-22 | /     data.iter() //~ ERROR 22:5: 23:20: the type of this value must be known in this context
+22 | /     data.iter() //~ ERROR 22:5: 23:20: type annotations needed
 23 | |         .sum::<_>()
    | |___________________^