]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/utils/inspector.rs
Use AnonConst for asm! constants
[rust.git] / src / tools / clippy / clippy_lints / src / utils / inspector.rs
index 6fd3c9d7dec25856f661f2f26e3e73d0d7b7e6dd..b3fe66ed4285eff8ba0a54f4e48275c70e0ee1ca 100644 (file)
@@ -306,7 +306,6 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
                 match op {
                     hir::InlineAsmOperand::In { expr, .. }
                     | hir::InlineAsmOperand::InOut { expr, .. }
-                    | hir::InlineAsmOperand::Const { expr }
                     | hir::InlineAsmOperand::Sym { expr } => print_expr(cx, expr, indent + 1),
                     hir::InlineAsmOperand::Out { expr, .. } => {
                         if let Some(expr) = expr {
@@ -319,6 +318,10 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
                             print_expr(cx, out_expr, indent + 1);
                         }
                     },
+                    hir::InlineAsmOperand::Const { anon_const } => {
+                        println!("{}anon_const:", ind);
+                        print_expr(cx, &cx.tcx.hir().body(anon_const.body).value, indent + 1);
+                    }
                 }
             }
         },