Rollup merge of - creativcoder:e0195, r=jonathandturner

Update E0195 to new error format

Fixes 
Part of 

r? @jonathandturner
This commit is contained in:
Guillaume Gomez 2016-08-23 22:48:03 +02:00 committed by GitHub
commit 142dc491e5
3 changed files with 6 additions and 3 deletions
src
librustc_typeck/check
test/compile-fail

@ -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;
}

@ -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
}
}

@ -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;
}
}