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