about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-05 02:21:13 +0000
committerbors <bors@rust-lang.org>2022-04-05 02:21:13 +0000
commita22cf2af0510b3ec4cbb19c3de11d3d8291349d9 (patch)
treef25421eaab99b5865f839a5315b36a834c632c74 /compiler/rustc_resolve/src
parent60e50fc1cfe0bb693a5f4f93eb83ef70854531e3 (diff)
parentb3c3eda7284b33e772f9ffe4e2ac1ebd18241601 (diff)
downloadrust-a22cf2af0510b3ec4cbb19c3de11d3d8291349d9.tar.gz
rust-a22cf2af0510b3ec4cbb19c3de11d3d8291349d9.zip
Auto merge of #95662 - Dylan-DPC:rollup-fo7jsr6, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #91873 (Mention implementers of unsatisfied trait)
 - #95588 (explicitly distinguish pointer::addr and pointer::expose_addr)
 - #95603 (Fix late-bound ICE in `dyn` return type suggestion)
 - #95620 (interpret: remove MemoryExtra in favor of giving access to the Machine)
 - #95630 (Update `NonNull` pointer provenance methods' documentation)
 - #95631 (Refactor: remove unnecessary nested blocks)
 - #95642 (`CandidateSource::XCandidate` -> `CandidateSource::X`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 400adf20cba..6fedabc816c 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -2297,21 +2297,19 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
         let prev = self.diagnostic_metadata.current_block_could_be_bare_struct_literal.take();
         if let (true, [Stmt { kind: StmtKind::Expr(expr), .. }]) =
             (block.could_be_bare_literal, &block.stmts[..])
+            && let ExprKind::Type(..) = expr.kind
         {
-            if let ExprKind::Type(..) = expr.kind {
-                self.diagnostic_metadata.current_block_could_be_bare_struct_literal =
-                    Some(block.span);
-            }
+            self.diagnostic_metadata.current_block_could_be_bare_struct_literal =
+            Some(block.span);
         }
         // Descend into the block.
         for stmt in &block.stmts {
-            if let StmtKind::Item(ref item) = stmt.kind {
-                if let ItemKind::MacroDef(..) = item.kind {
-                    num_macro_definition_ribs += 1;
-                    let res = self.r.local_def_id(item.id).to_def_id();
-                    self.ribs[ValueNS].push(Rib::new(MacroDefinition(res)));
-                    self.label_ribs.push(Rib::new(MacroDefinition(res)));
-                }
+            if let StmtKind::Item(ref item) = stmt.kind
+                && let ItemKind::MacroDef(..) = item.kind {
+                num_macro_definition_ribs += 1;
+                let res = self.r.local_def_id(item.id).to_def_id();
+                self.ribs[ValueNS].push(Rib::new(MacroDefinition(res)));
+                self.label_ribs.push(Rib::new(MacroDefinition(res)));
             }
 
             self.visit_stmt(stmt);