2019-12-30 13:30:34 +00:00
|
|
|
// 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`
|
2019-12-30 13:30:34 +00:00
|
|
|
// functions it has been asked to create.
|
2020-09-16 03:45:58 +01:00
|
|
|
|
2019-12-30 13:30:34 +00:00
|
|
|
// build-fail
|
2020-09-16 03:45:58 +01:00
|
|
|
// normalize-stderr-test: ".nll/" -> "/"
|
2020-10-17 00:00:00 +00:00
|
|
|
// compile-flags: -Zmir-opt-level=0
|
2019-12-30 13:30:34 +00:00
|
|
|
|
|
|
|
struct S<T> {
|
|
|
|
t: T,
|
|
|
|
s: Box<S<fn(u: T)>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f(x: S<u32>) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Force instantiation.
|
|
|
|
f as fn(_);
|
|
|
|
}
|