From 6d998d664bb51f6f28f55dba3b68ff6434b3435a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Mon, 15 Aug 2016 00:12:42 +0300 Subject: [PATCH] Update E0392 to new error format --- src/librustc_typeck/check/wfcheck.rs | 6 ++++-- src/test/compile-fail/E0392.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index e2080906ca2..628cb203ec7 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -653,8 +653,10 @@ fn error_380(ccx: &CrateCtxt, span: Span) { fn error_392<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, span: Span, param_name: ast::Name) -> DiagnosticBuilder<'tcx> { - struct_span_err!(ccx.tcx.sess, span, E0392, - "parameter `{}` is never used", param_name) + let mut err = struct_span_err!(ccx.tcx.sess, span, E0392, + "parameter `{}` is never used", param_name); + err.span_label(span, &format!("unused type parameter")); + err } fn error_194(tcx: TyCtxt, span: Span, name: ast::Name) { diff --git a/src/test/compile-fail/E0392.rs b/src/test/compile-fail/E0392.rs index 4c3efcf4e8d..a21e500e519 100644 --- a/src/test/compile-fail/E0392.rs +++ b/src/test/compile-fail/E0392.rs @@ -9,6 +9,7 @@ // except according to those terms. enum Foo { Bar } //~ ERROR E0392 + //~| NOTE unused type parameter fn main() { }