Skip to content

merged doctests: regressions due to examining process arguments #130796

Closed
@ehuss

Description

@ehuss

The crater run for merged doctests (#130285) detected a large number of regressions due to tests examining the process arguments. (I don't have an exact number, but let's say ~50 projects.)

Previously, there were no arguments, but now it gets arguments like *doctest-inner-test 0 which the user's CLI parsing code isn't expecting.

For example, using something like StructOpt::from_args will now fail.

It seems to be fairly common to have objects whose default constructor will parse the arguments from the command line.

I'm not sure if or how we should resolve that. One idea is to use a different mechanism for passing in the test information (like via an environment variable).

Meta

rustc 1.83.0-nightly (da889684c 2024-09-20)
binary: rustc
commit-hash: da889684c80508036ff036db8c159ffdcf27648a
commit-date: 2024-09-20
host: aarch64-apple-darwin
release: 1.83.0-nightly
LLVM version: 19.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocA-edition-2024Area: The 2024 editionC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions