rust/src/test/ui/issues/issue-8727.rs

16 lines
374 B
Rust
Raw Normal View History

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