diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-12-21 14:20:15 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-12-22 12:27:08 -0500 |
| commit | 763152b995bb506ac88c852a030c84a012bcf983 (patch) | |
| tree | 3145731ce8f9c63ea937f12ea8196d2f465f8911 | |
| parent | 2c76ced9540c1ae541d2f14e9d2c9fe702d4c3e0 (diff) | |
| download | rust-763152b995bb506ac88c852a030c84a012bcf983.tar.gz rust-763152b995bb506ac88c852a030c84a012bcf983.zip | |
Tweak region-related error messages that changed slightly due to coercion
changes, and also stop printing semi-useless inference by-products.
3 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index f05404759c4..aaa80f840fd 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -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 ", diff --git a/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs b/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs index 381144f2599..3e6a95b04f7 100644 --- a/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs @@ -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) { diff --git a/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs b/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs index a03911e1d0e..2d635e9fc27 100644 --- a/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs @@ -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) { |
