about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <yuki.okushi@huawei.com>2021-10-19 11:34:58 +0900
committerYuki Okushi <yuki.okushi@huawei.com>2021-10-26 11:02:51 +0900
commit630df7c54ab1b6d227893aae98bfdbf77228e637 (patch)
tree85385223dd14af1f364ddb24f73cfc5746c8e1b5
parentf5cbb9b9e6e8c2d2e1932b0e7b6556f689d44b0d (diff)
downloadrust-630df7c54ab1b6d227893aae98bfdbf77228e637.tar.gz
rust-630df7c54ab1b6d227893aae98bfdbf77228e637.zip
Remove unnecessary check for registers
`is_clobber()` already checks if `reg` is a register and the both
values should be the same.
-rw-r--r--compiler/rustc_ast_lowering/src/asm.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs
index 8aea37749c7..d0da88f1cc0 100644
--- a/compiler/rustc_ast_lowering/src/asm.rs
+++ b/compiler/rustc_ast_lowering/src/asm.rs
@@ -214,9 +214,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                 // means that we disallow passing a value in/out of the asm and
                 // require that the operand name an explicit register, not a
                 // register class.
-                if reg_class.is_clobber_only(asm_arch.unwrap())
-                    && !(op.is_clobber() && matches!(reg, asm::InlineAsmRegOrRegClass::Reg(_)))
-                {
+                if reg_class.is_clobber_only(asm_arch.unwrap()) && !op.is_clobber() {
                     let msg = format!(
                         "register class `{}` can only be used as a clobber, \
                              not as an input or output",