summary refs log tree commit diff
path: root/src/test/ui/issues/issue-8727.rs
blob: 80f360155cb49f272b08c2d6f44c946a7f8fac71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Verify the compiler fails with an error on infinite function
// recursions.

// build-fail

fn generic<T>() {
    generic::<Option<T>>();
}
//~^^^ ERROR reached the recursion limit while instantiating `generic::<std::option::Option<
//~| WARN function cannot return without recursing



fn main () {
    // Use generic<T> at least once to trigger instantiation.
    generic::<i32>();
}