2014-02-13 14:19:03 -06:00
|
|
|
// Verify the compiler fails with an error on infinite function
|
|
|
|
// recursions.
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
fn generic<T>() {
|
|
|
|
generic::<Option<T>>();
|
2014-02-14 10:42:23 -06:00
|
|
|
}
|
2018-07-15 16:11:54 -05:00
|
|
|
//~^^^ ERROR reached the recursion limit while instantiating `generic::<std::option::Option<
|
2018-08-21 01:09:15 -05:00
|
|
|
//~| WARN function cannot return without recursing
|
2018-07-15 16:11:54 -05:00
|
|
|
|
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
|
|
|
}
|