Skip to content

Remove env::set_var / env::remove_var in tests and build scripts #12238

@xtqqczze

Description

@xtqqczze

#12228 demonstrates a good step toward removing unnecessary unsafe usage and global environment mutation in tests. This change highlights a broader pattern in the codebase: extensive use of std::env::set_var and std::env::remove_var, which is both unsafe in practice (even if not marked unsafe) and makes code harder to reason about.

We should generalize this approach across the codebase, maybe by using Command::env.

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