Skip to content

Commit 710348f

Browse files
author
Jonathan Turner
authored
Rollup merge of #35296 - medzin:master, r=jonathandturner
Update error message E0178 Fixes #35273 as part of #35233.
2 parents ee8d494 + 08ff7a8 commit 710348f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/librustc_typeck/astconv.rs

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

src/test/compile-fail/E0178.rs

Lines changed: 12 additions & 4 deletions
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)