Skip to content

Commit 630df7c

Browse files
committed
Remove unnecessary check for registers
`is_clobber()` already checks if `reg` is a register and the both values should be the same.
1 parent f5cbb9b commit 630df7c

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+1
-3
lines changed

compiler/rustc_ast_lowering/src/asm.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
214214
// means that we disallow passing a value in/out of the asm and
215215
// require that the operand name an explicit register, not a
216216
// register class.
217-
if reg_class.is_clobber_only(asm_arch.unwrap())
218-
&& !(op.is_clobber() && matches!(reg, asm::InlineAsmRegOrRegClass::Reg(_)))
219-
{
217+
if reg_class.is_clobber_only(asm_arch.unwrap()) && !op.is_clobber() {
220218
let msg = format!(
221219
"register class `{}` can only be used as a clobber, \
222220
not as an input or output",

0 commit comments

Comments
 (0)