diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-02 19:34:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-02 19:34:07 +0100 |
| commit | 3388e6d9fda3d2bd637b35bbcd71b18d28a026b7 (patch) | |
| tree | abb103be7dd3844bc27b6ac1a5c118447341c54d /compiler/rustc_ast_lowering/src | |
| parent | 799bded9b44fd59b4647d4e2087b8d336f573bae (diff) | |
| parent | 670f5c6ef385f251df5cd7bcba9e8039a80bdb4d (diff) | |
| download | rust-3388e6d9fda3d2bd637b35bbcd71b18d28a026b7.tar.gz rust-3388e6d9fda3d2bd637b35bbcd71b18d28a026b7.zip | |
Rollup merge of #93590 - est31:let_else, r=lcnr
More let_else adoptions Continuation of #89933, #91018, #91481, #93046.
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 8b4a0840df5..cacc36b616a 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -471,9 +471,7 @@ impl<'hir> LoweringContext<'_, 'hir> { // two imports. for new_node_id in [id1, id2] { let new_id = self.resolver.local_def_id(new_node_id); - let res = if let Some(res) = resolutions.next() { - res - } else { + let Some(res) = resolutions.next() else { // Associate an HirId to both ids even if there is no resolution. let _old = self .node_id_to_hir_id diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index a594339296f..b1e601516ab 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -32,6 +32,7 @@ #![feature(crate_visibility_modifier)] #![feature(box_patterns)] +#![feature(let_else)] #![feature(never_type)] #![recursion_limit = "256"] #![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))] |
