rust/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
455 B
Rust
Raw Normal View History

// Dropck shouldn't hit a recursion limit from checking `S<u32>` since it has
// no free regions or type parameters.
2020-01-19 10:11:16 -06:00
// Codegen however, has to error for the infinitely many `drop_in_place`
// functions it has been asked to create.
// build-fail
// normalize-stderr-test: ".nll/" -> "/"
// compile-flags: -Zmir-opt-level=0
struct S<T> {
t: T,
s: Box<S<fn(u: T)>>,
}
fn f(x: S<u32>) {}
fn main() {
// Force instantiation.
f as fn(_);
}