about summary refs log tree commit diff
path: root/clippy_utils
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-08 08:19:17 +0100
committerGitHub <noreply@github.com>2024-03-08 08:19:17 +0100
commit15722797fe6879eef2c35f95b8507d260b85bf45 (patch)
treea6917e05556140898bd9b7e572604bd09d324880 /clippy_utils
parent7e83df40685907ea917813ec5b13fea360bdc070 (diff)
parenta4b413d4fd8244e8a54ada9ef6b99160d8f7f01c (diff)
downloadrust-15722797fe6879eef2c35f95b8507d260b85bf45.tar.gz
rust-15722797fe6879eef2c35f95b8507d260b85bf45.zip
Rollup merge of #119365 - nbdd0121:asm-goto, r=Amanieu
Add asm goto support to `asm!`

Tracking issue: #119364

This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto).

Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary.

r? ``@Amanieu``
cc ``@ojeda``
Diffstat (limited to 'clippy_utils')
-rw-r--r--clippy_utils/src/hir_utils.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs
index ef61b303f9c..f7f5f7ca35f 100644
--- a/clippy_utils/src/hir_utils.rs
+++ b/clippy_utils/src/hir_utils.rs
@@ -833,6 +833,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
                             self.hash_body(anon_const.body);
                         },
                         InlineAsmOperand::SymStatic { path, def_id: _ } => self.hash_qpath(path),
+                        InlineAsmOperand::Label { block } => self.hash_block(block),
                     }
                 }
             },