Skip to content

Avoid adding drops for types w/ no dtor in MIR construction #28159

Closed
@nikomatsakis

Description

@nikomatsakis

The MIR code currently adds drops for all types that are not Copy, even if we can see that there is no destructor (e.g., struct Foo(u32)). This is relatively harmless (trans ignores such types) but it means more memory alloc etc than necessary. See associated FIXME.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions