rust/compiler/rustc_mir_build
Tomasz Miąsko 10b722cc79 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.
2022-01-26 13:46:01 +01:00
..
src Ignore unwinding edges when checking for unconditional recursion 2022-01-26 13:46:01 +01:00
Cargo.toml Migrate to 2021 2021-09-20 22:21:42 -04:00