about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-08-14 20:29:52 +0300
committerGitHub <noreply@github.com>2016-08-14 20:29:52 +0300
commitf73f1282f59ee49cb7ff81631ba7c3b1cc60a45b (patch)
treedcf5349ffb4b61ed2dd253f49bc6043bce047317
parent50aa568709ee61c4f53c5555b2bc18d2d6c1003d (diff)
parent85388f0958f90f523102af1fb64c3b1a0aa164f6 (diff)
downloadrust-f73f1282f59ee49cb7ff81631ba7c3b1cc60a45b.tar.gz
rust-f73f1282f59ee49cb7ff81631ba7c3b1cc60a45b.zip
Rollup merge of #35646 - theypsilon:master, r=jonathandturner
E0094 error message updated

Part of #35233
Fixes #35231

r? @jonathandturner
-rw-r--r--src/librustc_typeck/check/intrinsic.rs6
-rw-r--r--src/test/compile-fail/E0094.rs1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs
index 9051b1c8069..084bbff3383 100644
--- a/src/librustc_typeck/check/intrinsic.rs
+++ b/src/librustc_typeck/check/intrinsic.rs
@@ -51,10 +51,12 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     }));
     let i_n_tps = i_ty.generics.types.len(subst::FnSpace);
     if i_n_tps != n_tps {
-        span_err!(tcx.sess, it.span, E0094,
+        struct_span_err!(tcx.sess, it.span, E0094,
             "intrinsic has wrong number of type \
              parameters: found {}, expected {}",
-             i_n_tps, n_tps);
+             i_n_tps, n_tps)
+             .span_label(it.span, &format!("expected {} type parameter", n_tps))
+             .emit();
     } else {
         require_same_types(ccx,
                            TypeOrigin::IntrinsicType(it.span),
diff --git a/src/test/compile-fail/E0094.rs b/src/test/compile-fail/E0094.rs
index 3a31874b244..d09353a2038 100644
--- a/src/test/compile-fail/E0094.rs
+++ b/src/test/compile-fail/E0094.rs
@@ -11,6 +11,7 @@
 #![feature(intrinsics)]
 extern "rust-intrinsic" {
     fn size_of<T, U>() -> usize; //~ ERROR E0094
+                                 //~| NOTE expected 1 type parameter
 }
 
 fn main() {