Skip to content

Commit 763152b

Browse files
committed
Tweak region-related error messages that changed slightly due to coercion
changes, and also stop printing semi-useless inference by-products.
1 parent 2c76ced commit 763152b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/librustc/middle/ty.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,6 +4577,10 @@ pub fn note_and_explain_type_err(cx: &ctxt, err: &type_err) {
45774577
"concrete lifetime that was found is ",
45784578
conc_region, "");
45794579
}
4580+
terr_regions_overly_polymorphic(_, ty::ReInfer(ty::ReVar(_))) => {
4581+
// don't bother to print out the message below for
4582+
// inference variables, it's not very illuminating.
4583+
}
45804584
terr_regions_overly_polymorphic(_, conc_region) => {
45814585
note_and_explain_region(cx,
45824586
"expected concrete lifetime is ",

src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn a<'a, 'b>(x: &mut &'a int, y: &mut &'b int) where 'b: 'a {
1515

1616
fn b<'a, 'b>(x: &mut &'a int, y: &mut &'b int) {
1717
// Illegal now because there is no `'b:'a` declaration.
18-
*x = *y; //~ ERROR mismatched types
18+
*x = *y; //~ ERROR cannot infer
1919
}
2020

2121
fn c<'a,'b>(x: &mut &'a int, y: &mut &'b int) {

src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ fn a<'a, 'b, 'c>(x: &mut &'a int, y: &mut &'b int, z: &mut &'c int) where 'b: 'a
1616

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

2323
fn c<'a,'b, 'c>(x: &mut &'a int, y: &mut &'b int, z: &mut &'c int) {

0 commit comments

Comments
 (0)