Skip to content

private macros break intra-doc links #81633

Closed
@digama0

Description

@digama0
mod bar {
    macro_rules! str {() => {}}
}

pub mod foo {
    use std::path::{Path, PathBuf};

    pub struct Foo(PathBuf);
    impl std::ops::Deref for Foo {
        type Target = Path;
        fn deref(&self) -> &Path { &self.0 }
    }
}

In the documentation of Foo::to_str() inherited from the deref impl, the documentation contains a link to [`&str`](str) that fails due to the presence of a str! macro in another module, even though that macro isn't accessible. (Even if it was, it shouldn't be affecting the resolution of an intra-doc link in the standard library.)

Meta

rustc --version --verbose:

rustc 1.51.0-nightly (0e63af5da 2021-01-31)
binary: rustc
commit-hash: 0e63af5da3400ace48a0345117980473fd21ad73
commit-date: 2021-01-31
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.P-lowLow priorityT-rustdocRelevant to the rustdoc 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