Skip to content

Commit

Permalink
Rollup merge of rust-lang#35296 - medzin:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Update error message E0178

Fixes rust-lang#35273 as part of rust-lang#35233.
  • Loading branch information
Jonathan Turner authored Aug 4, 2016
2 parents ee8d494 + 08ff7a8 commit 710348f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,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,
Expand Down
16 changes: 12 additions & 4 deletions src/test/compile-fail/E0178.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 710348f

Please sign in to comment.