Closed
Description
The goal would be to provide a trait to allow users to access tcx.type_of()
for definitions that have a type, such as FnDef, InstanceDef, StaticDef...
Something like:
trait CrateDefType : CrateDef {
fn ty(&self) -> Ty {
with(|cx| cx.type_of(self.def_id()))
}
}
I think this should be a separate trait, since not every CrateDef
has a type. Thus, only the ones that do should implement the new trait.
Metadata
Metadata
Assignees
Labels
No labels