]> git.lizzy.rs Git - rust.git/blob - src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs
Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt
[rust.git] / src / test / ui / recursion / issue-38591-non-regular-dropck-recursion.rs
1 // Dropck shouldn't hit a recursion limit from checking `S<u32>` since it has
2 // no free regions or type parameters.
3 // Codegen however, has to error for the infinitely many `drop_in_place`
4 // functions it has been asked to create.
5
6 // build-fail
7 // normalize-stderr-test: ".nll/" -> "/"
8 // compile-flags: -Zmir-opt-level=0
9
10 struct S<T> {
11     t: T,
12     s: Box<S<fn(u: T)>>,
13 }
14
15 fn f(x: S<u32>) {}
16
17 fn main() {
18     // Force instantiation.
19     f as fn(_);
20 }