Open SimonSapin opened 1 year ago
Good point, I think this needs an explicit check for recursion to break.
It's also a bit of a footgun, since recursive types have to be walked one-by-one, in general the goal of the crate is to avoid these as much as possible as to not accidentally introduce a lot of resource usage simply by connecting memory usage metrics :/
I'll have to see if I can figure out something.
Some data structures are inherently tree-shaped. Even if traversing them has non-trivial cost it may still be useful in an off-by-default code path to helps debug memory usage issues.
enum example:
Output on rustc 1.66.0-nightly (0ca356586 2022-10-06), almost the same as on 1.64.0:
struct example: