Skip to content

Commit

Permalink
Update error message for E0172
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Brunton committed Aug 4, 2016
1 parent 40f3ee2 commit ee8d6b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,10 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
Ok((trait_ref, projection_bounds))
}
_ => {
span_err!(self.tcx().sess, ty.span, E0172,
"expected a reference to a trait");
struct_span_err!(self.tcx().sess, ty.span, E0172,
"expected a reference to a trait")
.span_label(ty.span, &format!("expected a trait"))
.emit();
Err(ErrorReported)
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0172.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn foo(bar: i32+std::fmt::Display) {} //~ ERROR E0172
fn foo(bar: i32+std::fmt::Display) {}
//~^ ERROR E0172
//~| NOTE expected a trait

fn main() {
}

0 comments on commit ee8d6b0

Please sign in to comment.