Update error message E0178

This commit is contained in:
Adam Medziński 2016-08-04 16:24:39 +02:00
parent 271d048523
commit 08ff7a80c0
2 changed files with 13 additions and 4 deletions

View File

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

View File

@ -11,10 +11,18 @@
trait Foo {}
struct Bar<'a> {
w: &'a Foo + Copy, //~ ERROR E0178
x: &'a Foo + 'a, //~ ERROR E0178
y: &'a mut Foo + 'a, //~ ERROR E0178
z: fn() -> Foo + 'a, //~ ERROR E0178
w: &'a Foo + Copy,
//~^ ERROR E0178
//~| NOTE expected a path
x: &'a Foo + 'a,
//~^ ERROR E0178
//~| NOTE expected a path
y: &'a mut Foo + 'a,
//~^ ERROR E0178
//~| NOTE expected a path
z: fn() -> Foo + 'a,
//~^ ERROR E0178
//~| NOTE expected a path
}
fn main() {