Tweak region-related error messages that changed slightly due to coercion

changes, and also stop printing semi-useless inference by-products.
This commit is contained in:
Niko Matsakis 2014-12-21 14:20:15 -05:00
parent 2c76ced954
commit 763152b995
3 changed files with 7 additions and 3 deletions

View File

@ -4577,6 +4577,10 @@ pub fn note_and_explain_type_err(cx: &ctxt, err: &type_err) {
"concrete lifetime that was found is ",
conc_region, "");
}
terr_regions_overly_polymorphic(_, ty::ReInfer(ty::ReVar(_))) => {
// don't bother to print out the message below for
// inference variables, it's not very illuminating.
}
terr_regions_overly_polymorphic(_, conc_region) => {
note_and_explain_region(cx,
"expected concrete lifetime is ",

View File

@ -15,7 +15,7 @@ fn a<'a, 'b>(x: &mut &'a int, y: &mut &'b int) where 'b: 'a {
fn b<'a, 'b>(x: &mut &'a int, y: &mut &'b int) {
// Illegal now because there is no `'b:'a` declaration.
*x = *y; //~ ERROR mismatched types
*x = *y; //~ ERROR cannot infer
}
fn c<'a,'b>(x: &mut &'a int, y: &mut &'b int) {

View File

@ -16,8 +16,8 @@ fn a<'a, 'b, 'c>(x: &mut &'a int, y: &mut &'b int, z: &mut &'c int) where 'b: 'a
fn b<'a, 'b, 'c>(x: &mut &'a int, y: &mut &'b int, z: &mut &'c int) {
// Illegal now because there is no `'b:'a` declaration.
*x = *y; //~ ERROR mismatched types
*z = *y; //~ ERROR mismatched types
*x = *y; //~ ERROR cannot infer
*z = *y; //~ ERROR cannot infer
}
fn c<'a,'b, 'c>(x: &mut &'a int, y: &mut &'b int, z: &mut &'c int) {