mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
Extend temporary lifetimes if there is a ref in an enum binding
too. Previously I had omitted this case since function calls don't get the same treatment on the RHS, but it's different on the pattern and is more consistent -- the goal is to identify `let` statements where `ref` bindings create interior pointers.
This commit is contained in:
parent
56f4d1831a
commit
8f16356e5f
@ -637,6 +637,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
|
||||
*
|
||||
* P& = ref X
|
||||
* | StructName { ..., P&, ... }
|
||||
* | VariantName(..., P&, ...)
|
||||
* | [ ..., P&, ... ]
|
||||
* | ( ..., P&, ... )
|
||||
* | ~P&
|
||||
@ -656,6 +657,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
|
||||
pats3.iter().any(|&p| is_binding_pat(p))
|
||||
}
|
||||
|
||||
ast::PatEnum(_, Some(ref subpats)) |
|
||||
ast::PatTup(ref subpats) => {
|
||||
subpats.iter().any(|&p| is_binding_pat(p))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user