Skip to content

Commit 5ec6f39

Browse files
committed
Update E0195 to new error format
1 parent f013914 commit 5ec6f39

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/librustc_typeck/check/compare_method.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,11 @@ pub fn compare_impl_method<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
411411
// are zero. Since I don't quite know how to phrase things at
412412
// the moment, give a kind of vague error message.
413413
if trait_params.len() != impl_params.len() {
414-
span_err!(ccx.tcx.sess, span, E0195,
414+
struct_span_err!(ccx.tcx.sess, span, E0195,
415415
"lifetime parameters or bounds on method `{}` do \
416-
not match the trait declaration",
417-
impl_m.name);
416+
not match the trait declaration",impl_m.name)
417+
.span_label(span, &format!("lifetimes do not match trait"))
418+
.emit();
418419
return false;
419420
}
420421

src/test/compile-fail/E0195.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct Foo;
1616

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

src/test/compile-fail/issue-16048.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl<'a> Test<'a> for Foo<'a> {
2929
impl<'a> NoLifetime for Foo<'a> {
3030
fn get<'p, T : Test<'a>>(&self) -> T {
3131
//~^ ERROR E0195
32+
//~| lifetimes do not match trait
3233
return *self as T;
3334
}
3435
}

0 commit comments

Comments
 (0)