From 86a7fc840f11cd1f20fdf26d3071e34a2d4bc313 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Fri, 23 Feb 2024 19:56:35 +0100 Subject: compiler: clippy::complexity fixes --- compiler/rustc_const_eval/src/interpret/intern.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_const_eval/src') diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 959ec2ca865..82ce9ecd21d 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -140,7 +140,7 @@ pub fn intern_const_alloc_recursive< alloc.1.mutability = base_mutability; alloc.1.provenance().ptrs().iter().map(|&(_, prov)| prov).collect() } else { - intern_shallow(ecx, base_alloc_id, base_mutability).unwrap().map(|prov| prov).collect() + intern_shallow(ecx, base_alloc_id, base_mutability).unwrap().collect() }; // We need to distinguish "has just been interned" from "was already in `tcx`", // so we track this in a separate set. @@ -277,7 +277,7 @@ impl<'mir, 'tcx: 'mir, M: super::intern::CompileTimeMachine<'mir, 'tcx, !>> // We are not doing recursive interning, so we don't currently support provenance. // (If this assertion ever triggers, we should just implement a // proper recursive interning loop -- or just call `intern_const_alloc_recursive`. - if !self.tcx.try_get_global_alloc(prov.alloc_id()).is_some() { + if self.tcx.try_get_global_alloc(prov.alloc_id()).is_none() { panic!("`intern_with_temp_alloc` with nested allocations"); } } -- cgit 1.4.1-3-g733a5