mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
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:
parent
2c76ced954
commit
763152b995
@ -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 ",
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user