Skip to content

Commit

Permalink
Rollup merge of rust-lang#35671 - canaltinova:E0392, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0392 to new error format

Fixes rust-lang#35631. Part of rust-lang#35233
r? @jonathandturner or @GuillaumeGomez
  • Loading branch information
Jonathan Turner authored Aug 17, 2016
2 parents 02a8e2c + 6d998d6 commit 8ff8f77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,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) {
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0392.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

enum Foo<T> { Bar } //~ ERROR E0392
//~| NOTE unused type parameter

fn main() {
}

0 comments on commit 8ff8f77

Please sign in to comment.