mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
18 lines
313 B
Rust
18 lines
313 B
Rust
//@ run-pass
|
|
#![expect(incomplete_features)]
|
|
#![feature(explicit_tail_calls)]
|
|
|
|
use std::hint::black_box;
|
|
|
|
pub fn count(curr: u64, top: u64) -> u64 {
|
|
if black_box(curr) >= top {
|
|
curr
|
|
} else {
|
|
become count(curr + 1, top)
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
println!("{}", count(0, black_box(1000000)));
|
|
}
|