Say you have the following situation:
struct Worker {
person: Person,
job: Job
}
struct Person {
first_name: String,
last_name: String,
dob: DateTime,
address_line_1: String,
address_line_2: String,
address_line_3: String,
// lots more fields here
}
struct Job {
// similarly to person, lots of fields
}
You might think that the size of Worker was small, but in fact when you drill down its actually very big. Having this information might change design considerations, like when to Box. Could rustdoc give (or estimate) the size of any data-structures it documents?
In this case it would be fairly easy to drill down and see, but sometimes there are many levels of complex types, that may be generic, and it becomes a bit harder to tell.