Skip to content

Ungreat change to doctest test names #70090

Closed
@ehuss

Description

@ehuss

Doctest test names have changed due to #66364. Doc comments that pass through a macro defined in another crate now seem to report a different span.

lazy_static::lazy_static! {
    /// Comments
    /// ```
    /// assert!(true);
    /// ```
    static ref FOO: bool = true;
}

running with cargo test --doc previously looked like this:

test <::lazy_static::__lazy_static_internal macros> - FOO (line 26) ... ok

Now the test names look like this:

test /Users/eric/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs - FOO (line 159) ... ok

Frankly, neither are particularly great. It would be nice if the test name used the span from where the macro was invoked, not where it was defined.

rustc 1.43.0-nightly (c20d7eecb 2020-03-11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions