Skip to content

Re-exported types have confusingly different documentation #44306

Open
@dtolnay

Description

@dtolnay

Re-exported types seem to have more confusing documentation than the original type. I noticed this while reviewing rayon::Configuration which is re-exported from rayon-core.


original/src/lib.rs

pub trait T {}
pub struct S;

impl S {
    pub fn f<F>(_: F, _: Box<T>) -> Self
        where F: Fn()
    {
        unimplemented!()
    }
}

This is documented basically like what I wrote, which is what I would expect:

selection_063


src/lib.rs

extern crate original;
pub use original::S;

This is documented with a couple changes, all of which are technically correct but unexpected.

  • The Box<T> is now Box<T + 'static>.
  • The return type has changed from Self to S.
  • The where clause gives an explicit -> (). fixed as of 1.50
  • The parameter name placeholders are gone (which I prefer, but it is a difference).

selection_062

I am using rustc 1.22.0-nightly (f861b6e 2017-09-01).

@GuillaumeGomez

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.T-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