Skip to content

Missing Null Pointer Optimization Through Struct Indirection #19419

Closed
@mitsuhiko

Description

@mitsuhiko

Given a small wrapper struct around a box:

struct Wrapper<T> {
    ptr: Box<T>
}

Currently there is no null pointer optimization for a usage like Result<(), Wrapper<X>> whereas there is for Result<(), Box<X>>. The result in the first case will be two words whereas in the latter a single.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions