rust/src/test/ui/issues/issue-8727.rs
2019-12-21 22:16:00 +01:00

18 lines
389 B
Rust

// Verify the compiler fails with an error on infinite function
// recursions.
// build-fail
fn generic<T>() {
generic::<Option<T>>();
}
//~^^^ ERROR reached the recursion limit while instantiating `generic::<std::option::Option<
//~| WARN function cannot return without recursing
fn main () {
// Use generic<T> at least once to trigger instantiation.
generic::<i32>();
}