Skip to content

Commit ee8d6b0

Browse files
author
Roy Brunton
committed
Update error message for E0172
1 parent 40f3ee2 commit ee8d6b0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/librustc_typeck/astconv.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,10 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
10751075
Ok((trait_ref, projection_bounds))
10761076
}
10771077
_ => {
1078-
span_err!(self.tcx().sess, ty.span, E0172,
1079-
"expected a reference to a trait");
1078+
struct_span_err!(self.tcx().sess, ty.span, E0172,
1079+
"expected a reference to a trait")
1080+
.span_label(ty.span, &format!("expected a trait"))
1081+
.emit();
10801082
Err(ErrorReported)
10811083
}
10821084
}

src/test/compile-fail/E0172.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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

1315
fn main() {
1416
}

0 commit comments

Comments
 (0)