cargo-sync-readme icon indicating copy to clipboard operation
cargo-sync-readme copied to clipboard

Links to standard library do not work for re-exported symbols

Open orium opened this issue 5 years ago • 1 comments

Intralinks do not resolve re-exports. This means that if you have

mod foo {
    pub mod bar {
        struct Bar {}
    }
}

pub use foo::bar;

you cannot have an intra-link to crate::bar::Bar, because re-exports are not resolved when considering intra-links.

This would be a reasonably acceptable limitation, if it wasn't a very common pattern in the standard library. For instance things defined in alloc are then re-exported in std, for instance, you cannot link to ::std::vec::Vec. This makes it a much more annoying limitation which deserves to be fixed.

I'll try to work on this soon.

orium avatar Jan 15 '21 11:01 orium

Something that we need to support is crate imports with rename, because that's a common pattern in the standard library. For instance, this is how std::vec comes to be:

extern crate alloc as alloc_crate;
⋮
pub use alloc_crate::vec;

This is independent from supporting use re-exports, so I will first open a PR for that.

orium avatar Jan 24 '21 20:01 orium