mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Add MutatingUseContext::Yield
...emulating `MutatingUseContext::Call`
This commit is contained in:
parent
e5f35df2c6
commit
d0086166b7
@ -269,7 +269,8 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
||||
|
||||
fn visit_local(&mut self, &local: &mir::Local, context: PlaceContext, location: Location) {
|
||||
match context {
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Call) => {
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Call)
|
||||
| PlaceContext::MutatingUse(MutatingUseContext::Yield) => {
|
||||
self.assign(local, location);
|
||||
}
|
||||
|
||||
|
@ -510,7 +510,7 @@ macro_rules! make_mir_visitor {
|
||||
self.visit_operand(value, source_location);
|
||||
self.visit_place(
|
||||
resume_arg,
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Store),
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Yield),
|
||||
source_location,
|
||||
);
|
||||
}
|
||||
@ -1052,6 +1052,8 @@ pub enum MutatingUseContext {
|
||||
AsmOutput,
|
||||
/// Destination of a call.
|
||||
Call,
|
||||
/// Destination of a yield.
|
||||
Yield,
|
||||
/// Being dropped.
|
||||
Drop,
|
||||
/// Mutable borrow.
|
||||
|
@ -133,6 +133,7 @@ pub fn categorize(context: PlaceContext) -> Option<DefUse> {
|
||||
// the def in call only to the input from the success
|
||||
// path and not the unwind path. -nmatsakis
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Call) |
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Yield) |
|
||||
|
||||
// Storage live and storage dead aren't proper defines, but we can ignore
|
||||
// values that come before them.
|
||||
|
Loading…
Reference in New Issue
Block a user