2022-06-28 22:56:32 +02:00
|
|
|
// `S` is infinitely recursing so it's not possible to generate a finite
|
2024-12-04 21:03:12 -05:00
|
|
|
// drop impl.
|
2022-06-28 22:56:32 +02:00
|
|
|
//
|
|
|
|
// Dropck should therefore detect that this is the case and eagerly error.
|
2019-12-30 13:30:34 +00:00
|
|
|
|
|
|
|
struct S<T> {
|
|
|
|
t: T,
|
|
|
|
s: Box<S<fn(u: T)>>,
|
|
|
|
}
|
|
|
|
|
2024-11-05 21:54:45 +00:00
|
|
|
fn f(x: S<u32>) {} //~ ERROR overflow while adding drop-check rules for `S<u32>`
|
2019-12-30 13:30:34 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Force instantiation.
|
|
|
|
f as fn(_);
|
|
|
|
}
|