2014-02-13 14:19:03 -06:00
|
|
|
// Verify the compiler fails with an error on infinite function
|
|
|
|
// recursions.
|
|
|
|
|
2019-12-13 21:28:32 -06:00
|
|
|
// build-fail
|
|
|
|
|
2020-06-21 21:32:35 -05:00
|
|
|
fn generic<T>() { //~ WARN function cannot return without recursing
|
2015-02-12 09:29:52 -06:00
|
|
|
generic::<Option<T>>();
|
2014-02-14 10:42:23 -06:00
|
|
|
}
|
2020-09-02 02:40:56 -05:00
|
|
|
//~^^ ERROR reached the recursion limit while instantiating `generic::<Option<
|
2014-02-13 14:19:03 -06:00
|
|
|
|
|
|
|
|
|
|
|
fn main () {
|
|
|
|
// Use generic<T> at least once to trigger instantiation.
|
2015-02-12 09:29:52 -06:00
|
|
|
generic::<i32>();
|
2014-02-13 14:19:03 -06:00
|
|
|
}
|