Skip to content

Commit

Permalink
Rollup merge of rust-lang#35939 - creativcoder:e0195, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0195 to new error format

Fixes rust-lang#35511
Part of rust-lang#35233

r? @jonathandturner
  • Loading branch information
eddyb authored Aug 23, 2016
2 parents 151e900 + 5ec6f39 commit 26432c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustc_typeck/check/compare_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,11 @@ pub fn compare_impl_method<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
// are zero. Since I don't quite know how to phrase things at
// the moment, give a kind of vague error message.
if trait_params.len() != impl_params.len() {
span_err!(ccx.tcx.sess, span, E0195,
struct_span_err!(ccx.tcx.sess, span, E0195,
"lifetime parameters or bounds on method `{}` do \
not match the trait declaration",
impl_m.name);
not match the trait declaration",impl_m.name)
.span_label(span, &format!("lifetimes do not match trait"))
.emit();
return false;
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0195.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct Foo;

impl Trait for Foo {
fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195
//~^ lifetimes do not match trait
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-16048.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl<'a> Test<'a> for Foo<'a> {
impl<'a> NoLifetime for Foo<'a> {
fn get<'p, T : Test<'a>>(&self) -> T {
//~^ ERROR E0195
//~| lifetimes do not match trait
return *self as T;
}
}
Expand Down

0 comments on commit 26432c6

Please sign in to comment.