Update error message for E0172

This commit is contained in:
Roy Brunton 2016-08-04 15:13:46 +01:00
parent 40f3ee2a01
commit ee8d6b0709
2 changed files with 7 additions and 3 deletions

View File

@ -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)
}
}

View File

@ -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() {
}