Auto merge of #42931 - arielb1:statement-visitor, r=eddyb
re-add the call to `super_statement` in EraseRegions The move gathering code is sensitive to type-equality - that is rather un-robust and I plan to fix it eventually, but that's a more invasive change. And we want to fix the visitor anyway. Fixes #42903. r? @eddyb
This commit is contained in:
commit
6b52a1162e
2 changed files with 18 additions and 2 deletions
|
|
@ -67,12 +67,13 @@ impl<'a, 'tcx> MutVisitor<'tcx> for EraseRegionsVisitor<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_statement(&mut self,
|
||||
_block: BasicBlock,
|
||||
block: BasicBlock,
|
||||
statement: &mut Statement<'tcx>,
|
||||
_location: Location) {
|
||||
location: Location) {
|
||||
if let StatementKind::EndRegion(_) = statement.kind {
|
||||
statement.kind = StatementKind::Nop;
|
||||
}
|
||||
self.super_statement(block, statement, location);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,18 @@ fn struct_dynamic_drop(a: &Allocator, c0: bool, c1: bool, c: bool) {
|
|||
}
|
||||
}
|
||||
|
||||
fn field_assignment(a: &Allocator, c0: bool) {
|
||||
let mut x = (TwoPtrs(a.alloc(), a.alloc()), a.alloc());
|
||||
|
||||
x.1 = a.alloc();
|
||||
x.1 = a.alloc();
|
||||
|
||||
let f = (x.0).0;
|
||||
if c0 {
|
||||
(x.0).0 = f;
|
||||
}
|
||||
}
|
||||
|
||||
fn assignment2(a: &Allocator, c0: bool, c1: bool) {
|
||||
let mut _v = a.alloc();
|
||||
let mut _w = a.alloc();
|
||||
|
|
@ -207,5 +219,8 @@ fn main() {
|
|||
run_test(|a| struct_dynamic_drop(a, true, true, false));
|
||||
run_test(|a| struct_dynamic_drop(a, true, true, true));
|
||||
|
||||
run_test(|a| field_assignment(a, false));
|
||||
run_test(|a| field_assignment(a, true));
|
||||
|
||||
run_test_nopanic(|a| union1(a));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue