Skip to content

Commit

Permalink
Tweak region-related error messages that changed slightly due to coer…
Browse files Browse the repository at this point in the history
…cion

changes, and also stop printing semi-useless inference by-products.
  • Loading branch information
nikomatsakis committed Dec 22, 2014
1 parent 2c76ced commit 763152b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 763152b

Please sign in to comment.