Skip to content

Reexports docs are ignored #19396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HectorMRC opened this issue Mar 19, 2025 · 3 comments
Closed

Reexports docs are ignored #19396

HectorMRC opened this issue Mar 19, 2025 · 3 comments
Labels
C-bug Category: bug

Comments

@HectorMRC
Copy link

HectorMRC commented Mar 19, 2025

rust-analyzer version: 0.3.2345-standalone (b0632f7 2025-03-16)

rustc version: rustc 1.86.0-nightly (ae5de6c75 2025-01-29)

editor or extension: VSCode

code snippet to reproduce:

// bar/src/lib.rs

pub struct Bar;
// foo/src/lib.rs

/// Documentation for this reexport.
#[doc(inline)]
pub use bar::Bar;

When putting the cursor over a reexported type, VSCode does not show the docs from the reexport.
In the example above, when using the reexported Bar type from foo, VSCode does not display Documentation for this reexport. as part of the Bar documentation.
Instead it would only show the documentation set for Bar at the bar crate, if any.

@HectorMRC HectorMRC added the C-bug Category: bug label Mar 19, 2025
@HectorMRC HectorMRC changed the title Reexport's cargo-doc is ignored Reexports docs are ignored Mar 19, 2025
@ChayimFriedman2
Copy link
Contributor

This is quite problematic, because for e.g.:

// bar/src/lib.rs

pub struct Bar;

// foo/src/lib.rs
/// Documentation for this reexport.
#[doc(inline)]
pub use bar::Bar;

// baz/src/lib.rs
use foo::Bar;

fn foo() -> Bar { ... }

When hovering over the return type of foo(), we have no way to tell the reexport it came from. All we know is the use in baz and the original definition. And I think it'll be quite confusing if we would show it only when hovering over the direct reexport.

@Veykril
Copy link
Member

Veykril commented Mar 19, 2025

Duplicate of #14079

@Veykril Veykril marked this as a duplicate of #14079 Mar 19, 2025
@Veykril Veykril closed this as completed Mar 19, 2025
@Veykril
Copy link
Member

Veykril commented Mar 19, 2025

But yes, as far as types are concerned, after lowering into type-ir any association will be gone. That part is a wont-fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants