Skip to content

Rustdoc fails to build diesel documentation on current nightly #100620

Closed
@weiznich

Description

@weiznich
Contributor

Code

I tried this code:

$ git clone https://github.com/weiznich/diesel
$ cd diesel
$ git checkout af0398991219e793f9bc0f0f690513310addb3af
$ cargo +nightly doc --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "i-implement-a-third-party-backend-and-opt-into-breaking-changes"

I expected to see this happen: Rustdoc compiles the documentation as for older toolchains (stable, < nightly-2022-08-10) or as it is happening for cargo build/cargo check

Instead, this happened: Rustdoc reports an compiler error

error[E0275]: overflow evaluating the requirement `_: std::marker::Sized`
    --> diesel/src/query_dsl/mod.rs:1401:15
     |
1401 |         Self: methods::ExecuteDsl<Conn>,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`diesel`)
note: required because of the requirements on the impl of `query_builder::QueryFragment<_>` for `query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H, LC>`
    --> diesel/src/query_builder/select_statement/mod.rs:162:40
     |
162  | impl<F, S, D, W, O, LOf, G, H, LC, DB> QueryFragment<DB>
     |                                        ^^^^^^^^^^^^^^^^^
163  |     for SelectStatement<F, S, D, W, O, LOf, G, H, LC>
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: 127 redundant requirements hidden
     = note: required because of the requirements on the impl of `query_builder::QueryFragment<_>` for `query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H, LC>`
note: required because of the requirements on the impl of `query_dsl::load_dsl::ExecuteDsl<Conn, _>` for `query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H, LC>`
    --> diesel/src/query_dsl/load_dsl.rs:98:19
     |
98   | impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T
     |                   ^^^^^^^^^^^^^^^^^^^^     ^

For more information about this error, try `rustc --explain E0275`.

Version it worked on

It most recently worked on: nightly-2022-08-09

Version with regression

rustc --version --verbose:

rustc 1.65.0-nightly (34a6cae28 2022-08-09)
binary: rustc
commit-hash: 34a6cae28e7013ff0e640026a8e46f315426829d
commit-date: 2022-08-09
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 14.0.6

rustdoc --version --verbose:

rustdoc 1.65.0-nightly (34a6cae28 2022-08-09)
binary: rustdoc
commit-hash: 34a6cae28e7013ff0e640026a8e46f315426829d
commit-date: 2022-08-09
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 14.0.6

cargo-rustc-bisect points to 6d3f1be as merge that introduced this regression which is a roll-up PR.

#100221 and #99787 are included there and seems to be rustdoc releated. Pinging @compiler-errors and @aDotInTheVoid as authors of these PR's.

Activity

added
C-bugCategory: This is a bug.
regression-untriagedUntriaged performance or correctness regression.
on Aug 16, 2022
added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
and removed
regression-untriagedUntriaged performance or correctness regression.
on Aug 16, 2022
GuillaumeGomez

GuillaumeGomez commented on Aug 16, 2022

@GuillaumeGomez
Member

I think the bug is coming from #100221.

cc @compiler-errors

EDIT: also, would be quite useful to have a minimum code that we can use as a regression test.

weiznich

weiznich commented on Aug 16, 2022

@weiznich
ContributorAuthor

EDIT: also, would be quite useful to have a minimum code that we can use as a regression test.

Reducing compiler errors coming from diesel is quite hard and takes a lot of time. Diesel is already part of the rust compiler tests-suite, although in an older version. So it might be easier to just update this version to a current diesel version.

compiler-errors

compiler-errors commented on Aug 16, 2022

@compiler-errors
Member

This is due to my PR. @rustbot claim

GuillaumeGomez

GuillaumeGomez commented on Aug 16, 2022

@GuillaumeGomez
Member

Reducing compiler errors coming from diesel is quite hard and takes a lot of time. Diesel is already part of the rust compiler tests-suite, although in an older version. So it might be easier to just update this version to a current diesel version.

diesel is not documented inside the compiler so it wouldn't be very helpful unfortunately. Also, I didn't ask you specifically, just thought it might be useful to say it, so don't worry if you don't have time for it. 😉

This is due to my PR. @rustbot claim

Thanks @compiler-errors !

weiznich

weiznich commented on Aug 16, 2022

@weiznich
ContributorAuthor

diesel is not documented inside the compiler so it wouldn't be very helpful unfortunately. Also, I didn't ask you specifically, just thought it might be useful to say it, so don't worry if you don't have time for it. wink

The corresponding test code is here:

I think it did not catch this issue as it uses an older diesel version (and it does not enable the corresponding feature flag).

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Aug 17, 2022
compiler-errors

compiler-errors commented on Aug 18, 2022

@compiler-errors
Member

I minimized this:

pub trait Bar<S> {}

pub trait Qux<T> {}

pub trait Foo<T, S> {
    fn bar()
    where
        T: Bar<S>,
    {
    }
}

pub struct Concrete;

impl<S> Foo<(), S> for Concrete {}

impl<T, S> Bar<S> for T where S: Qux<T> {}

impl<T, S> Qux<T> for S where T: Bar<S> {}

And fix PR incoming.

12 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @weiznich@GuillaumeGomez@compiler-errors@apiraino@rustbot

    Issue actions

      Rustdoc fails to build diesel documentation on current nightly · Issue #100620 · rust-lang/rust