diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-14 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-26 13:46:01 +0100 |
| commit | 10b722cc79c52a242d8671243b46e0319296cb30 (patch) | |
| tree | 26210348bba44429efd195a78a4f8d36470a9a1d /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 788b1fe5b79a8b74215022f9df49b0eae68a50b9 (diff) | |
| download | rust-10b722cc79c52a242d8671243b46e0319296cb30.tar.gz rust-10b722cc79c52a242d8671243b46e0319296cb30.zip | |
Ignore unwinding edges when checking for unconditional recursion
The unconditional recursion lint determines if all execution paths
eventually lead to a self-recursive call.
The implementation always follows unwinding edges which limits its
practical utility. For example, it would not lint function `f` because a
call to `g` might unwind. It also wouldn't lint function `h` because an
overflow check preceding the self-recursive call might unwind:
```rust
pub fn f() {
g();
f();
}
pub fn g() { /* ... */ }
pub fn h(a: usize) {
h(a + 1);
}
```
To avoid the issue, assume that terminators that might continue
execution along non-unwinding edges do so.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
