]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/expr_use_visitor.rs
fix most compiler/ doctests
[rust.git] / compiler / rustc_typeck / src / expr_use_visitor.rs
index 055e391d7069efe430ead0b1dd899a1405ad360f..e69ba99dcef4266b8ced208ef4f1806b83115111 100644 (file)
@@ -358,8 +358,7 @@ pub fn walk_expr(&mut self, expr: &hir::Expr<'_>) {
             hir::ExprKind::InlineAsm(asm) => {
                 for (op, _op_sp) in asm.operands {
                     match op {
-                        hir::InlineAsmOperand::In { expr, .. }
-                        | hir::InlineAsmOperand::Sym { expr, .. } => self.consume_expr(expr),
+                        hir::InlineAsmOperand::In { expr, .. } => self.consume_expr(expr),
                         hir::InlineAsmOperand::Out { expr: Some(expr), .. }
                         | hir::InlineAsmOperand::InOut { expr, .. } => {
                             self.mutate_expr(expr);
@@ -371,7 +370,9 @@ pub fn walk_expr(&mut self, expr: &hir::Expr<'_>) {
                             }
                         }
                         hir::InlineAsmOperand::Out { expr: None, .. }
-                        | hir::InlineAsmOperand::Const { .. } => {}
+                        | hir::InlineAsmOperand::Const { .. }
+                        | hir::InlineAsmOperand::SymFn { .. }
+                        | hir::InlineAsmOperand::SymStatic { .. } => {}
                     }
                 }
             }
@@ -697,12 +698,13 @@ fn walk_pat(&mut self, discr_place: &PlaceWithHirId<'tcx>, pat: &hir::Pat<'_>) {
     /// In the following example the closures `c` only captures `p.x` even though `incr`
     /// is a capture of the nested closure
     ///
-    /// ```rust,ignore(cannot-test-this-because-pseudo-code)
-    /// let p = ..;
+    /// ```
+    /// struct P { x: i32 }
+    /// let mut p = P { x: 4 };
     /// let c = || {
     ///    let incr = 10;
     ///    let nested = || p.x += incr;
-    /// }
+    /// };
     /// ```
     ///
     /// - When reporting the Place back to the Delegate, ensure that the UpvarId uses the enclosing