]> git.lizzy.rs Git - rust.git/blob - tests/ui/recursion/issue-38591-non-regular-dropck-recursion.rs
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
[rust.git] / tests / ui / recursion / issue-38591-non-regular-dropck-recursion.rs
1 // `S` is infinitely recursing so it's not possible to generate a finite
2 // drop impl (ignoring polymorphization).
3 //
4 // Dropck should therefore detect that this is the case and eagerly error.
5
6 struct S<T> {
7     t: T,
8     s: Box<S<fn(u: T)>>,
9 }
10
11 fn f(x: S<u32>) {} //~ ERROR overflow while adding drop-check rules for S<u32>
12
13 fn main() {
14     // Force instantiation.
15     f as fn(_);
16 }