]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-8727.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / issues / issue-8727.rs
CommitLineData
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 7fn 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
13fn main () {
14 // Use generic<T> at least once to trigger instantiation.
85aaf69f 15 generic::<i32>();
1a4d82fc 16}