Make calling resource destructors work cross-crate
Tydescs are currently re-created for each compilation unit (and I guess for structural types, they have to be, though the duplication still bothers me). This means a destructor can not be inlined in the drop glue for a resource type, since other crates don't have access to the destructor body. Destructors are now compiled as separate functions with an external symbol that can be looked up in the crate (under the resource type's def_id), and called from the drop glue.
Showing
想要评论请 注册 或 登录