Skip to content

Commit

Permalink
Fix handling on InlineAsm for the unconditional recursion lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed May 18, 2020
1 parent 46db0df commit 9215ead
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/librustc_mir_build/lints.rs
Expand Up @@ -114,9 +114,14 @@ impl<'mir, 'tcx> TriColorVisitor<&'mir Body<'tcx>> for Search<'mir, 'tcx> {
| TerminatorKind::Unreachable
| TerminatorKind::Yield { .. } => ControlFlow::Break(NonRecursive),

// FIXME(Amanieu): I am not 100% sure about this, but it triggers
// a spurious warning otherwise.
TerminatorKind::InlineAsm { .. } => ControlFlow::Break(NonRecursive),
// A diverging InlineAsm is treated as non-recursing
TerminatorKind::InlineAsm { destination, .. } => {
if destination.is_some() {
ControlFlow::Continue
} else {
ControlFlow::Break(NonRecursive)
}
}

// These do not.
TerminatorKind::Assert { .. }
Expand Down

0 comments on commit 9215ead

Please sign in to comment.