diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml index f139a0f37387fbfa62da4a9c776ff3cb5d2b5b8c..a4f08575ed7e43af7b407427472c317c9ac777ff 100644 --- a/rr_frontend/.cargo/config.toml +++ b/rr_frontend/.cargo/config.toml @@ -80,7 +80,6 @@ rustflags = [ "-Aclippy::unwrap_in_result", # clippy::style - "-Aclippy::map_clone", "-Aclippy::match_like_matches_macro", "-Aclippy::needless_borrow", "-Aclippy::needless_late_init", diff --git a/rr_frontend/attribute_parse/src/parse.rs b/rr_frontend/attribute_parse/src/parse.rs index ba579e35080da20c08102fc14addd5a67d494277..2f182e9807721693bff77e700ceb0330ef52191b 100644 --- a/rr_frontend/attribute_parse/src/parse.rs +++ b/rr_frontend/attribute_parse/src/parse.rs @@ -121,7 +121,7 @@ pub struct ParseBuffer { impl ParseBuffer { pub fn new(stream: &rustc_ast::tokenstream::TokenStream) -> Self { // TODO; maybe avoid the cloning - let trees: Vec<TokenTree> = stream.trees().map(|c| c.clone()).collect(); + let trees: Vec<TokenTree> = stream.trees().cloned().collect(); Self { trees, diff --git a/rr_frontend/translation/src/environment/polonius_info.rs b/rr_frontend/translation/src/environment/polonius_info.rs index 4aa0bed1f8d2da830c69cee3406715b56feb977d..2d16fdaf96c13bbade29bd04b3a454827c95559c 100644 --- a/rr_frontend/translation/src/environment/polonius_info.rs +++ b/rr_frontend/translation/src/environment/polonius_info.rs @@ -1080,7 +1080,7 @@ impl<'a, 'tcx: 'a> PoloniusInfo<'a, 'tcx> { /// Get the location at which a loan is created, if possible pub fn get_loan_location(&self, loan: &facts::Loan) -> Option<mir::Location> { - self.loan_position.get(loan).map(|r| *r) + self.loan_position.get(loan).copied() } /// Get the loan that gets created at a location. diff --git a/rr_frontend/translation/src/function_body.rs b/rr_frontend/translation/src/function_body.rs index 998c0278decacccdf9e9ec0727dc2887e3f8e15a..006cce4bd6c544fe79e6d33fc141eb07c59b3a98 100644 --- a/rr_frontend/translation/src/function_body.rs +++ b/rr_frontend/translation/src/function_body.rs @@ -3176,7 +3176,7 @@ impl<'a, 'def: 'a, 'tcx: 'def> BodyTranslator<'a, 'def, 'tcx> { } let struct_use = - self.ty_translator.generate_tuple_use(operand_types.iter().map(|r| *r))?; + self.ty_translator.generate_tuple_use(operand_types.iter().copied())?; let sl = struct_use.generate_raw_syn_type_term(); let initializers: Vec<_> = translated_ops.into_iter().enumerate().map(|(i, o)| (i.to_string(), o)).collect(); @@ -3264,7 +3264,7 @@ impl<'a, 'def: 'a, 'tcx: 'def> BodyTranslator<'a, 'def, 'tcx> { } let struct_use = - self.ty_translator.generate_tuple_use(operand_types.iter().map(|r| *r))?; + self.ty_translator.generate_tuple_use(operand_types.iter().copied())?; let sl = struct_use.generate_raw_syn_type_term(); let initializers: Vec<_> = diff --git a/rr_frontend/translation/src/type_translator.rs b/rr_frontend/translation/src/type_translator.rs index 3521954cd9268883b990ba48277a36f44477541b..75abc297cc1edb0b8e061d0661811d15c9417970 100644 --- a/rr_frontend/translation/src/type_translator.rs +++ b/rr_frontend/translation/src/type_translator.rs @@ -284,8 +284,7 @@ impl<'def, 'tcx: 'def> TypeTranslator<'def, 'tcx> { /// Lookup a shim for an ADT. fn lookup_adt_shim(&self, did: DefId) -> Option<radium::LiteralTypeRef<'def>> { - let shims = self.adt_shims.borrow(); - shims.get(&did).map(|x| *x) + self.adt_shims.borrow().get(&did).copied() } /// Get all the struct definitions that clients have used (excluding the variants of enums).