mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 06:47:34 +00:00
Prefer type annotations and returns in free region errors
This commit is contained in:
parent
22cc2ae805
commit
a2c24873b1
@ -138,6 +138,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
| ConstraintCategory::Boring
|
||||
| ConstraintCategory::BoringNoLocation
|
||||
| ConstraintCategory::Internal => false,
|
||||
ConstraintCategory::TypeAnnotation
|
||||
| ConstraintCategory::Return => true,
|
||||
_ => constraint_sup_scc != target_scc,
|
||||
}
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | foo(x, y)
|
||||
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
|
||||
| ^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user