Rust: Missing Implementors for Join and Pattern trait in rustdoc

Created on 16 Aug 2020  路  13Comments  路  Source: rust-lang/rust

Missing Implementors for std::slice::Join trait.

Current output:
image

While rustdoc displays Borrow trait implementors.

Expected:
Display Implementors for Join trait: https://github.com/rust-lang/rust/blob/de32266a1780aa4ef748ce7f6200a1554fad0aca/library/alloc/src/slice.rs#L635-L703

Meta

rustc --version --verbose: 1.47.0-nightly (9b88e0a86 2020-08-15)

@rustbot modify labels: T-rustdoc

C-bug P-high T-rustdoc regression-from-stable-to-beta

All 13 comments

This is a regression from stable-to-nightly: https://doc.rust-lang.org/1.45.2/std/slice/trait.Join.html and beta one has Implementors section.

cc @jyn514

It has made it way to beta. Pattern trait is also affected: https://doc.rust-lang.org/beta/std/str/pattern/trait.Pattern.html#implementors

@rustbot modify labels: I-prioritize

(Btw I think you can use @rustbot prioritize as a shorthand)

The Borrow trait still has Implementors section, I am not sure if this bug affect crates in ecosystem.

So I think this bug shouldn't affect stable traits, just most unstable traits I saw are affected.

There is high change that #73767 causing the regression, but I cannot prove that.

This is more likely to be https://github.com/rust-lang/rust/pull/73771 than the refactor I think.

Yeah, I suspect that given https://github.com/rust-lang/rust/issues/74672 it might make sense to revert anyway, since it doesn't actually accomplish the goal.

Or someone more experienced with rustdoc may be able to suggest/implement a better patch.

New discovery: So far only trait exported to std affected. For example with Join trait, in alloc it is normal: https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html

Oh right, I have MCVE, it needs two dummy crates.

dummy crate "unstabled"

#![crate_name = "unstabled"]
#![feature(staged_api)]
#![unstable(feature = "thisisnotreal", issue = "27747")]

#[unstable(feature = "asdfasdfasdfa", issue = "27747")]
pub struct Foo<T: Sized + Clone> {
    #[unstable(feature = "asdfasdfasdfa", issue = "27747")]
    bytes: [T],
}

#[unstable(feature = "asdfasdfasdfa", issue = "27747")]
pub trait Join {
    #[unstable(feature = "asdfasdfasdfa", issue = "27747")]
    type Output;

    #[unstable(feature = "asdfasdfasdfa", issue = "27747")]
    fn join(slice: &Self) -> Self::Output;
}

#[unstable(feature = "asdfasdfasdfa", issue = "27747")]
impl<T: Sized + Clone> Join for Foo<T> {
    type Output = Vec<T>;

    fn join(slice: &Self) -> Vec<T> {
        unimplemented!()
    }
}

Crate to run cargo doc:

#![feature(asdfasdfasdfa)]

pub use unstabled::Join;

@rustbot modify labels: -E-needs-mcve

searched nightlies: from nightly-2020-06-04 to nightly-2020-07-17
regressed nightly: nightly-2020-07-17
searched commits: from https://github.com/rust-lang/rust/commit/7e11379f3b4c376fbb9a6c4d44f3286ccc28d149 to https://github.com/rust-lang/rust/commit/5c9e5df3a097e094641f16dab501ab1c4da10e9f
regressed commit: https://github.com/rust-lang/rust/commit/5c9e5df3a097e094641f16dab501ab1c4da10e9f


bisected with cargo-bisect-rustc v0.5.2

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 2020-06-04 --end 2020-07-17 --script=./test.bash --without-cargo 

That rollup includes both https://github.com/rust-lang/rust/pull/73771 and https://github.com/rust-lang/rust/pull/73566; of the two I think 73771 is the more likely culprit.

Was this page helpful?
0 / 5 - 0 ratings