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