]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Verify the compiler fails with an error on infinite function |
2 | // recursions. | |
3 | ||
dfeec247 | 4 | // build-fail |
1b1a35ee | 5 | // normalize-stderr-test: ".nll/" -> "/" |
dfeec247 | 6 | |
f035d41b | 7 | fn generic<T>() { //~ WARN function cannot return without recursing |
85aaf69f | 8 | generic::<Option<T>>(); |
1a4d82fc | 9 | } |
1b1a35ee | 10 | //~^^ ERROR reached the recursion limit while instantiating `generic::<Option< |
1a4d82fc JJ |
11 | |
12 | ||
13 | fn main () { | |
14 | // Use generic<T> at least once to trigger instantiation. | |
85aaf69f | 15 | generic::<i32>(); |
1a4d82fc | 16 | } |