Rollup merge of #35980 - kyrias:E0094-underline, r=jonathandturner

Make E0094 underline better

r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-08-27 12:43:30 -07:00 committed by GitHub
commit 965f50dad5

View File

@ -51,12 +51,17 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
}));
let i_n_tps = i_ty.generics.types.len();
if i_n_tps != n_tps {
struct_span_err!(tcx.sess, it.span, E0094,
"intrinsic has wrong number of type \
parameters: found {}, expected {}",
i_n_tps, n_tps)
.span_label(it.span, &format!("expected {} type parameter", n_tps))
.emit();
let span = match it.node {
hir::ForeignItemFn(_, ref generics) => generics.span().unwrap_or(it.span),
hir::ForeignItemStatic(_, _) => it.span
};
struct_span_err!(tcx.sess, span, E0094,
"intrinsic has wrong number of type \
parameters: found {}, expected {}",
i_n_tps, n_tps)
.span_label(span, &format!("expected {} type parameter", n_tps))
.emit();
} else {
require_same_types(ccx,
TypeOrigin::IntrinsicType(it.span),