unconditional_recursion
only catches direct recursion, not mutual recursion. So it wouldn't even catch
impl Drop for Resource {
fn drop(self) {
drop(self);
}
}
That's what I mentioned in the thread @CAD97 linked in the OP: we already have syntax for "destructure the type", so we could just require that implementations of the new drop method uses that in the parameter pattern. It's a simple and clear restriction that's entirely local.
On back-compat: we can have drop glue work by calling existing drop with &mut Self
, then new drop with Self
. People could implement either, both, or neither.