about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2022-05-07 02:56:46 +0100
committerGary Guo <gary@garyguo.net>2022-05-07 03:32:27 +0100
commitd93b03793d4b6bcbc5cd5c0715df31bfcff15845 (patch)
treecd725c62aff3d647e8f5bcd20d6ef5782c729469
parentcf5748f43f3796732248fc90a404b6fe6cb05ce3 (diff)
downloadrust-d93b03793d4b6bcbc5cd5c0715df31bfcff15845.tar.gz
rust-d93b03793d4b6bcbc5cd5c0715df31bfcff15845.zip
Remove wfness requirement from anon consts used by asm
-rw-r--r--compiler/rustc_typeck/src/check/expr.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs
index a1e8d2040dd..416ca2b2360 100644
--- a/compiler/rustc_typeck/src/check/expr.rs
+++ b/compiler/rustc_typeck/src/check/expr.rs
@@ -2591,10 +2591,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         self.check_expr_asm_operand(out_expr, false);
                     }
                 }
-                hir::InlineAsmOperand::Const { anon_const }
-                | hir::InlineAsmOperand::SymFn { anon_const } => {
-                    self.to_const(anon_const);
-                }
+                // `AnonConst`s have their own body and is type-checked separately.
+                // As they don't flow into the type system we don't need them to
+                // be well-formed.
+                hir::InlineAsmOperand::Const { .. } | hir::InlineAsmOperand::SymFn { .. } => {}
                 hir::InlineAsmOperand::SymStatic { .. } => {}
             }
         }