]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_ast_lowering/src/block.rs
Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisa
[rust.git] / compiler / rustc_ast_lowering / src / block.rs
index 09fcdfc1c9716cba32c2684e1bd2ce0ea1cc00d7..7cbfe143b4d83d3701a7b30e5571f8e4d4322c1c 100644 (file)
@@ -36,20 +36,6 @@ fn lower_stmts(
             match s.kind {
                 StmtKind::Local(ref local) => {
                     let hir_id = self.lower_node_id(s.id);
-                    let els = if let LocalKind::InitElse(_, els) = &local.kind {
-                        if !self.tcx.features().let_else {
-                            feature_err(
-                                &self.tcx.sess.parse_sess,
-                                sym::let_else,
-                                s.span,
-                                "`let...else` statements are unstable",
-                            )
-                            .emit();
-                        }
-                        Some(self.lower_block(els, false))
-                    } else {
-                        None
-                    };
                     let local = self.lower_local(local);
                     self.alias_attrs(hir_id, local.hir_id);
                     let kind = hir::StmtKind::Local(local);
@@ -106,9 +92,9 @@ fn lower_local(&mut self, l: &Local) -> &'hir hir::Local<'hir> {
         let hir_id = self.lower_node_id(l.id);
         let pat = self.lower_pat(&l.pat);
         let els = if let LocalKind::InitElse(_, els) = &l.kind {
-            if !self.sess.features_untracked().let_else {
+            if !self.tcx.features().let_else {
                 feature_err(
-                    &self.sess.parse_sess,
+                    &self.tcx.sess.parse_sess,
                     sym::let_else,
                     l.span,
                     "`let...else` statements are unstable",