about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-03-14 18:10:25 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-03-14 19:14:30 -0700
commit1bbd4fd395b7b8f5f51f90401665168b19f0b9fd (patch)
tree2ca92999b1d4922d2a4817f3a9d38f4a567f0c19
parentbfc66daef9d1bdc52000cf8c079ea8572699f6c0 (diff)
downloadrust-1bbd4fd395b7b8f5f51f90401665168b19f0b9fd.tar.gz
rust-1bbd4fd395b7b8f5f51f90401665168b19f0b9fd.zip
Add span label to E0044
-rw-r--r--src/librustc_typeck/check/mod.rs1
-rw-r--r--src/test/ui/closure-move-sync.stderr2
-rw-r--r--src/test/ui/error-codes/E0044.rs1
-rw-r--r--src/test/ui/error-codes/E0044.stderr2
4 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 92c6e3ffed2..8fe9c62927e 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -1222,6 +1222,7 @@ pub fn check_item_type<'a,'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, it: &'tcx hir::Item
                 if !generics.types.is_empty() {
                     let mut err = struct_span_err!(tcx.sess, item.span, E0044,
                         "foreign items may not have type parameters");
+                    err.span_label(item.span, "can't have type parameters");
                     // FIXME: once we start storing spans for type arguments, turn this into a
                     // suggestion.
                     err.help("use specialization instead of type parameters by replacing them \
diff --git a/src/test/ui/closure-move-sync.stderr b/src/test/ui/closure-move-sync.stderr
index abf07d2cef5..076bae8dbd7 100644
--- a/src/test/ui/closure-move-sync.stderr
+++ b/src/test/ui/closure-move-sync.stderr
@@ -22,4 +22,4 @@ LL |     thread::spawn(|| tx.send(()).unwrap());
 
 error: aborting due to 2 previous errors
 
-If you want more information on this error, try using "rustc --explain E0277"
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/error-codes/E0044.rs b/src/test/ui/error-codes/E0044.rs
index 4d20edea5fe..35e3c768558 100644
--- a/src/test/ui/error-codes/E0044.rs
+++ b/src/test/ui/error-codes/E0044.rs
@@ -12,6 +12,7 @@ extern {
     fn sqrt<T>(f: T) -> T;
     //~^ ERROR foreign items may not have type parameters [E0044]
     //~| HELP use specialization instead of type parameters by replacing them with concrete types
+    //~| NOTE can't have type parameters
 }
 
 fn main() {
diff --git a/src/test/ui/error-codes/E0044.stderr b/src/test/ui/error-codes/E0044.stderr
index 12324e771d3..0e22818f789 100644
--- a/src/test/ui/error-codes/E0044.stderr
+++ b/src/test/ui/error-codes/E0044.stderr
@@ -2,7 +2,7 @@ error[E0044]: foreign items may not have type parameters
   --> $DIR/E0044.rs:12:5
    |
 LL |     fn sqrt<T>(f: T) -> T;
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^ can't have type parameters
    |
    = help: use specialization instead of type parameters by replacing them with concrete types like `u32`