Simplify some nested if statements
This commit is contained in:
@@ -2069,12 +2069,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
|
||||
// no move out from an earlier location) then this is an attempt at initialization
|
||||
// of the union - we should error in that case.
|
||||
let tcx = this.infcx.tcx;
|
||||
if base.ty(this.body(), tcx).ty.is_union() {
|
||||
if this.move_data.path_map[mpi].iter().any(|moi| {
|
||||
if base.ty(this.body(), tcx).ty.is_union()
|
||||
&& this.move_data.path_map[mpi].iter().any(|moi| {
|
||||
this.move_data.moves[*moi].source.is_predecessor_of(location, this.body)
|
||||
}) {
|
||||
return;
|
||||
}
|
||||
})
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.report_use_of_moved_or_uninitialized(
|
||||
|
||||
Reference in New Issue
Block a user