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