Skip to content

Commit

Permalink
Rollup merge of rust-lang#35294 - Roybie:35272-E0172-update-error-for…
Browse files Browse the repository at this point in the history
…mat, r=jonathandturner

Update error message for E0172

Fixes rust-lang#35272 as part of rust-lang#35233.

r? @jonathandturner
  • Loading branch information
GuillaumeGomez authored Aug 5, 2016
2 parents d11d25b + ee8d6b0 commit 6bcd080
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 6bcd080

Please sign in to comment.