Skip to content

Fix memory leaks in doctests? #126067

Closed
Closed
@RalfJung

Description

@RalfJung

Currently a bunch of our doctests have memory leaks. For that reason, we have to disable Miri's leak checker when running doctests.

To reproduce:

MIRIFLAGS="-Zmiri-disable-isolation" ./x.py miri library/core library/alloc --doc
MIRIFLAGS="-Zmiri-disable-isolation" ./x.py miri library/std --doc -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::

@rust-lang/libs how do you feel about that -- is it okay for the tests to leak, or should we fix that (by adding hidden code that deallocates things again)? Currently we don't have a good way to disable the leak checker on a per-test basis so there is a risk of accidental leaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-allocatorsArea: Custom and system allocatorsE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-libsRelevant to the library 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