Skip to content

memory leak in DiagnosticBuilder.into_diagnostic() #69600

Closed
@dwrensha

Description

@dwrensha

This code leaks the Box at self.0:

unsafe {
diagnostic = std::ptr::read(&self.0.diagnostic);
std::mem::forget(self);
};

The leak was introduced in 2fcd870. cc @nnethercote

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions