diff options
| author | Gary Guo <gary@garyguo.net> | 2023-12-26 15:28:42 +0000 | 
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2024-02-24 18:50:09 +0000 | 
| commit | b044aaa905f8a97e67ea72b490ee46d6420c4680 (patch) | |
| tree | 8295ee7af568898a8a2da15d9710dab5c44b3480 /compiler/rustc_mir_build/src/lints.rs | |
| parent | 7152993aa859819d67b9f01e41e1f389e52043de (diff) | |
| download | rust-b044aaa905f8a97e67ea72b490ee46d6420c4680.tar.gz rust-b044aaa905f8a97e67ea72b490ee46d6420c4680.zip  | |
Change InlineAsm to allow multiple targets instead
Diffstat (limited to 'compiler/rustc_mir_build/src/lints.rs')
| -rw-r--r-- | compiler/rustc_mir_build/src/lints.rs | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/lints.rs b/compiler/rustc_mir_build/src/lints.rs index 3f2b7c482a6..2c817d605af 100644 --- a/compiler/rustc_mir_build/src/lints.rs +++ b/compiler/rustc_mir_build/src/lints.rs @@ -199,9 +199,10 @@ impl<'mir, 'tcx, C: TerminatorClassifier<'tcx>> TriColorVisitor<BasicBlocks<'tcx | TerminatorKind::Unreachable | TerminatorKind::Yield { .. } => ControlFlow::Break(NonRecursive), - // A diverging InlineAsm is treated as non-recursing - TerminatorKind::InlineAsm { destination, .. } => { - if destination.is_some() { + // A InlineAsm without targets (diverging and contains no labels) + // is treated as non-recursing. + TerminatorKind::InlineAsm { ref targets, .. } => { + if !targets.is_empty() { ControlFlow::Continue(()) } else { ControlFlow::Break(NonRecursive)  | 
