17 lines
244 B
Rust
17 lines
244 B
Rust
|
#![feature(custom_attribute)]
|
||
|
#![allow(unused_attributes)]
|
||
|
|
||
|
#[miri_run]
|
||
|
#[inline(never)]
|
||
|
pub fn main() {
|
||
|
assert_eq!(fib(10), 55);
|
||
|
}
|
||
|
|
||
|
fn fib(n: usize) -> usize {
|
||
|
if n <= 2 {
|
||
|
1
|
||
|
} else {
|
||
|
fib(n - 1) + fib(n - 2)
|
||
|
}
|
||
|
}
|