diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml index 427810847b102598e75ae8224f2b28ee89d36253..1d5024c15a97ebdbf6b4dc822a56587fc7b8aefc 100644 --- a/rr_frontend/.cargo/config.toml +++ b/rr_frontend/.cargo/config.toml @@ -59,7 +59,6 @@ rustflags = [ "-Aclippy::unused_self", # clippy::perf - "-Aclippy::manual_retain", "-Aclippy::map_entry", "-Aclippy::single_char_pattern", "-Aclippy::to_string_in_format_args", diff --git a/rr_frontend/translation/src/environment/loops.rs b/rr_frontend/translation/src/environment/loops.rs index 5e7656689579bb5a8d84e292de60049f76372881..af4ca78e234eed348764994d7d59fb633016b849 100644 --- a/rr_frontend/translation/src/environment/loops.rs +++ b/rr_frontend/translation/src/environment/loops.rs @@ -475,24 +475,19 @@ impl ProcedureLoops { debug!("accesses_pairs = {:?}", accesses_pairs); if let Some(paths) = definitely_initalised_paths { debug!("definitely_initalised_paths = {:?}", paths); - accesses_pairs = accesses_pairs - .into_iter() - .filter(|(place, kind)| { - paths.iter().any(|initialised_place| - // If the prefix is definitely initialised, then this place is a potential - // loop invariant. - utils::is_prefix(place, initialised_place) || - // If the access is store, then we only need the path to exist, which is - // guaranteed if we have at least some of the leaves still initialised. - // - // Note that the Rust compiler is even more permissive as explained in this - // issue: https://github.com/rust-lang/rust/issues/21232. - ( - *kind == PlaceAccessKind::Store && - utils::is_prefix(initialised_place, place) - )) - }) - .collect(); + accesses_pairs.retain(|(place, kind)| { + paths.iter().any(|initialised_place| + // If the prefix is definitely initialised, then this place is a potential + // loop invariant. + utils::is_prefix(place, initialised_place) || + // If the access is store, then we only need the path to exist, which is + // guaranteed if we have at least some of the leaves still initialised. + // + // Note that the Rust compiler is even more permissive as explained in this + // issue: https://github.com/rust-lang/rust/issues/21232. + *kind == PlaceAccessKind::Store && + utils::is_prefix(initialised_place, place)) + }); } debug!("accesses_pairs = {:?}", accesses_pairs); // Paths to whose leaves we need write permissions.