Skip to content

Commit 08ff7a8

Browse files
author
Adam Medziński
committed
Update error message E0178
1 parent 271d048 commit 08ff7a8

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/librustc_typeck/astconv.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
10861086
"expected a path on the left-hand side \
10871087
of `+`, not `{}`",
10881088
pprust::ty_to_string(ty));
1089+
err.span_label(ty.span, &format!("expected a path"));
10891090
let hi = bounds.iter().map(|x| match *x {
10901091
hir::TraitTyParamBound(ref tr, _) => tr.span.hi,
10911092
hir::RegionTyParamBound(ref r) => r.span.hi,

src/test/compile-fail/E0178.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
trait Foo {}
1212

1313
struct Bar<'a> {
14-
w: &'a Foo + Copy, //~ ERROR E0178
15-
x: &'a Foo + 'a, //~ ERROR E0178
16-
y: &'a mut Foo + 'a, //~ ERROR E0178
17-
z: fn() -> Foo + 'a, //~ ERROR E0178
14+
w: &'a Foo + Copy,
15+
//~^ ERROR E0178
16+
//~| NOTE expected a path
17+
x: &'a Foo + 'a,
18+
//~^ ERROR E0178
19+
//~| NOTE expected a path
20+
y: &'a mut Foo + 'a,
21+
//~^ ERROR E0178
22+
//~| NOTE expected a path
23+
z: fn() -> Foo + 'a,
24+
//~^ ERROR E0178
25+
//~| NOTE expected a path
1826
}
1927

2028
fn main() {

0 commit comments

Comments
 (0)