The new messages seem universally better. I think these result because
we recognize that we are in an invariant context more often.
// over time, but this test used to exhibit some pretty bogus messages
// that were not remotely helpful.
// over time, but this test used to exhibit some pretty bogus messages
// that were not remotely helpful.
-// error-pattern:cannot infer
-// error-pattern:cannot outlive the lifetime 'a
-// error-pattern:must be valid for the static lifetime
+// error-pattern:the lifetime 'a
+// error-pattern:the static lifetime
struct Invariant<'a>(Option<&'a mut &'a mut ()>);
struct Invariant<'a>(Option<&'a mut &'a mut ()>);
fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy {
// Without knowing 'a:'b, we can't coerce
fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy {
// Without knowing 'a:'b, we can't coerce
- x //~ ERROR cannot infer an appropriate lifetime
+ x //~ ERROR lifetime bound not satisfied
//~^ ERROR cannot infer an appropriate lifetime
}
//~^ ERROR cannot infer an appropriate lifetime
}
-> Box<Get<&'min i32>>
where 'max : 'min
{
-> Box<Get<&'min i32>>
where 'max : 'min
{
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
where 'max : 'min
{
// Previously OK:
where 'max : 'min
{
// Previously OK:
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types
where 'max : 'min
{
// Previously OK, now an error as traits are invariant.
where 'max : 'min
{
// Previously OK, now an error as traits are invariant.
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
-> Box<Get<&'max i32>>
where 'max : 'min
{
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
-> Box<Get<&'max i32>>
where 'max : 'min
{
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types
-> Box<Get<&'min i32>>
where 'max : 'min
{
-> Box<Get<&'min i32>>
where 'max : 'min
{
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
-> Box<Get<&'max i32>>
where 'max : 'min
{
}
fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
-> Box<Get<&'max i32>>
where 'max : 'min
{
- v //~ ERROR cannot infer an appropriate lifetime
+ v //~ ERROR mismatched types