summary refs log tree commit diff
path: root/compiler/rustc_monomorphize/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-17 23:00:59 +0100
committerGitHub <noreply@github.com>2022-02-17 23:00:59 +0100
commit637d8b89e8b433f5eb93f9d7ea8e8599a15a6451 (patch)
tree57fd94ebeaa8c6f14282d566a4502089b80a9410 /compiler/rustc_monomorphize/src
parent09350d2cf0bc3d931b47dfc4fdee69e76a0a50ad (diff)
parent60f969a4f24c44f4ec763027bfbfe1747ae876b6 (diff)
downloadrust-637d8b89e8b433f5eb93f9d7ea8e8599a15a6451.tar.gz
rust-637d8b89e8b433f5eb93f9d7ea8e8599a15a6451.zip
Rollup merge of #94011 - est31:let_else, r=lcnr
Even more let_else adoptions

Continuation of #89933, #91018, #91481, #93046, #93590.
Diffstat (limited to 'compiler/rustc_monomorphize/src')
-rw-r--r--compiler/rustc_monomorphize/src/collector.rs4
-rw-r--r--compiler/rustc_monomorphize/src/util.rs6
2 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs
index 8a1fe6e91cb..72c1b3fa6e9 100644
--- a/compiler/rustc_monomorphize/src/collector.rs
+++ b/compiler/rustc_monomorphize/src/collector.rs
@@ -947,9 +947,7 @@ fn visit_instance_use<'tcx>(
 /// Returns `true` if we should codegen an instance in the local crate, or returns `false` if we
 /// can just link to the upstream crate and therefore don't need a mono item.
 fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) -> bool {
-    let def_id = if let Some(def_id) = instance.def.def_id_if_not_guaranteed_local_codegen() {
-        def_id
-    } else {
+    let Some(def_id) = instance.def.def_id_if_not_guaranteed_local_codegen() else {
         return true;
     };
 
diff --git a/compiler/rustc_monomorphize/src/util.rs b/compiler/rustc_monomorphize/src/util.rs
index 27540395c07..04baa01832b 100644
--- a/compiler/rustc_monomorphize/src/util.rs
+++ b/compiler/rustc_monomorphize/src/util.rs
@@ -8,13 +8,11 @@ use std::io::prelude::*;
 /// During the same compile all closures dump the information in the same file
 /// "closure_profile_XXXXX.csv", which is created in the directory where the compiler is invoked.
 crate fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: Instance<'tcx>) {
-    let mut file = if let Ok(file) = OpenOptions::new()
+    let Ok(mut file) = OpenOptions::new()
         .create(true)
         .append(true)
         .open(&format!("closure_profile_{}.csv", std::process::id()))
-    {
-        file
-    } else {
+    else {
         eprintln!("Cound't open file for writing closure profile");
         return;
     };