use let chains in hir, lint, mir

This commit is contained in:
Kivooeo
2025-07-26 06:21:54 +05:00
parent 43725ed819
commit bae38bad78
24 changed files with 278 additions and 307 deletions

View File

@@ -637,16 +637,13 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
debug!("initializes move_indexes {:?}", init_loc_map[location]);
state.gen_all(init_loc_map[location].iter().copied());
if let mir::StatementKind::StorageDead(local) = stmt.kind {
if let mir::StatementKind::StorageDead(local) = stmt.kind
// End inits for StorageDead, so that an immutable variable can
// be reinitialized on the next iteration of the loop.
if let Some(move_path_index) = rev_lookup.find_local(local) {
debug!(
"clears the ever initialized status of {:?}",
init_path_map[move_path_index]
);
state.kill_all(init_path_map[move_path_index].iter().copied());
}
&& let Some(move_path_index) = rev_lookup.find_local(local)
{
debug!("clears the ever initialized status of {:?}", init_path_map[move_path_index]);
state.kill_all(init_path_map[move_path_index].iter().copied());
}
}