diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-23 19:56:35 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-23 19:56:35 +0100 |
| commit | 86a7fc840f11cd1f20fdf26d3071e34a2d4bc313 (patch) | |
| tree | 825af3e5f80cc4cb41aca59fe20467a382b2ae22 /compiler/rustc_const_eval/src/interpret | |
| parent | b6a23b853719c8c22c022993c9eb2871b09fc2b9 (diff) | |
| download | rust-86a7fc840f11cd1f20fdf26d3071e34a2d4bc313.tar.gz rust-86a7fc840f11cd1f20fdf26d3071e34a2d4bc313.zip | |
compiler: clippy::complexity fixes
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/intern.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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"); } } |
