about summary refs log tree commit diff
path: root/tests/ui/recursion/recursion-tail-call-no-arg-leak.rs
blob: fe10b8907006ec464375113cee4fd2e7681d23dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! This test verifies that tail call optimization does not lead to argument slot leaks.
//!
//! Regression test for: <https://github.com/rust-lang/rust/issues/160>

//@ run-pass

fn inner(dummy: String, b: bool) {
    if b {
        return inner(dummy, false);
    }
}

pub fn main() {
    inner("hi".to_string(), true);
}