diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-05-26 13:14:24 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2022-05-26 13:14:24 +0200 |
| commit | 5fc8a8e22799b6d2d768e5cbb59003930631c2f2 (patch) | |
| tree | beb0859c2eba3e0f578962a73590eacde9b2f988 /compiler/rustc_const_eval/src/interpret | |
| parent | 8bf9c20765bd206dd5ec3c5840cee315c17521aa (diff) | |
| download | rust-5fc8a8e22799b6d2d768e5cbb59003930631c2f2.tar.gz rust-5fc8a8e22799b6d2d768e5cbb59003930631c2f2.zip | |
clippy::complexity fixes
clone_on_copy useless_format bind_instead_of_map filter_map_identity useless_conversion map_flatten unnecessary_unwrap
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/eval_context.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 4c84bd090cb..0c954ac6e5f 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -520,13 +520,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { frame .instance .try_subst_mir_and_normalize_erasing_regions(*self.tcx, self.param_env, value) - .or_else(|e| { + .map_err(|e| { self.tcx.sess.delay_span_bug( self.cur_span(), format!("failed to normalize {}", e.get_type_for_failure()).as_str(), ); - Err(InterpError::InvalidProgram(InvalidProgramInfo::TooGeneric)) + InterpError::InvalidProgram(InvalidProgramInfo::TooGeneric) }) } @@ -1009,11 +1009,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug } } - write!( - fmt, - ": {:?}", - self.ecx.dump_allocs(allocs.into_iter().filter_map(|x| x).collect()) - ) + write!(fmt, ": {:?}", self.ecx.dump_allocs(allocs.into_iter().flatten().collect())) } Place::Ptr(mplace) => match mplace.ptr.provenance.and_then(Provenance::get_alloc_id) { Some(alloc_id) => write!( |
