Skip to content
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

Cross-crate re-export produces invalid rustdoc for impl Trait #62779

Closed
fatemender opened this issue Jul 18, 2019 · 3 comments
Closed

Cross-crate re-export produces invalid rustdoc for impl Trait #62779

fatemender opened this issue Jul 18, 2019 · 3 comments
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fatemender
Copy link

In a cross-crate reexport of an impl Trait-accepting function, rustdoc formats it in a wrong way which is not even valid Rust.

Let crate1 be:

pub trait MyTrait {}
pub fn accepts_impl(_t: impl MyTrait) {}

Let crate2 be:

pub use crate1::{MyTrait, accepts_impl};

If we generate docs for crate2, we get this definition for the (re-exported) accepts_impl:

pub fn accepts_impl<impl MyTrait>(_t: impl MyTrait) 
where
    impl MyTrait: MyTrait, 

I see some similarities with #60113 here.
Both issues still reproduce on stable 1.36.0 and nightly bc2e84c.

@jonas-schievink jonas-schievink added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 18, 2019
@sinkuu
Copy link
Contributor

sinkuu commented Jul 18, 2019

#61613 should fix this problem.

@Disasm
Copy link
Contributor

Disasm commented Feb 11, 2020

It seems this issue is no longer present.
rustc 1.41.0 (5e1a79984 2020-01-27)

@jyn514
Copy link
Member

jyn514 commented Aug 27, 2020

Closing since this was fixed by #61613

@jyn514 jyn514 closed this as completed Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants