2025-07-01 20:20:14 +05:00
|
|
|
//! 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>
|
|
|
|
|
|
2019-07-27 00:54:25 +03:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2025-07-01 20:20:14 +05:00
|
|
|
fn inner(dummy: String, b: bool) {
|
|
|
|
|
if b {
|
|
|
|
|
return inner(dummy, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2014-05-12 17:56:43 -07:00
|
|
|
pub fn main() {
|
2014-05-25 03:17:19 -07:00
|
|
|
inner("hi".to_string(), true);
|
2014-05-12 17:56:43 -07:00
|
|
|
}
|