Add new MutatatingUseContext
s for deinit and SetDiscriminant
This commit is contained in:
parent
f7ca97a209
commit
48b01a0d0e
9 changed files with 57 additions and 41 deletions
|
@ -897,8 +897,10 @@ impl Visitor<'_> for CanConstProp {
|
|||
// mutations of the same local via `Store`
|
||||
| MutatingUse(MutatingUseContext::Call)
|
||||
| MutatingUse(MutatingUseContext::AsmOutput)
|
||||
| MutatingUse(MutatingUseContext::Deinit)
|
||||
// Actual store that can possibly even propagate a value
|
||||
| MutatingUse(MutatingUseContext::Store) => {
|
||||
| MutatingUse(MutatingUseContext::Store)
|
||||
| MutatingUse(MutatingUseContext::SetDiscriminant) => {
|
||||
if !self.found_assignment.insert(local) {
|
||||
match &mut self.can_const_prop[local] {
|
||||
// If the local can only get propagated in its own block, then we don't have
|
||||
|
|
|
@ -778,7 +778,9 @@ impl Visitor<'_> for CanConstProp {
|
|||
// mutations of the same local via `Store`
|
||||
| MutatingUse(MutatingUseContext::Call)
|
||||
| MutatingUse(MutatingUseContext::AsmOutput)
|
||||
| MutatingUse(MutatingUseContext::Deinit)
|
||||
// Actual store that can possibly even propagate a value
|
||||
| MutatingUse(MutatingUseContext::SetDiscriminant)
|
||||
| MutatingUse(MutatingUseContext::Store) => {
|
||||
if !self.found_assignment.insert(local) {
|
||||
match &mut self.can_const_prop[local] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue