Adopt let_else across the compiler
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
This commit is contained in:
parent
c1026539bd
commit
1418df5888
51 changed files with 69 additions and 137 deletions
|
@ -2,6 +2,7 @@
|
|||
#![feature(bool_to_option)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(let_else)]
|
||||
#![feature(in_band_lifetimes)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
|
|
|
@ -451,9 +451,7 @@ fn mono_item_visibility(
|
|||
let is_generic = instance.substs.non_erasable_generics().next().is_some();
|
||||
|
||||
// Upstream `DefId` instances get different handling than local ones.
|
||||
let def_id = if let Some(def_id) = def_id.as_local() {
|
||||
def_id
|
||||
} else {
|
||||
let Some(def_id) = def_id.as_local() else {
|
||||
return if export_generics && is_generic {
|
||||
// If it is an upstream monomorphization and we export generics, we must make
|
||||
// it available to downstream crates.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue