Skip to content

Rustdoc fails to build diesel documentation on current nightly #100620

Description

@weiznich

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

  1. added
    C-bugCategory: This is a bug.
    regression-untriagedUntriaged performance or correctness regression.
    on Aug 16, 2022
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    and removed
    regression-untriagedUntriaged performance or correctness regression.
    on Aug 16, 2022
  3. 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.

  4. 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.

  5. compiler-errors commented on Aug 16, 2022

    @compiler-errors
    Contributor

    This is due to my PR. @rustbot claim

  6. 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 !

  7. 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).

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

    @compiler-errors
    Contributor

    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.

  10. added a commit that references this issue on Aug 25, 2022
    d0bfa26
  11. added a commit that references this issue on Aug 26, 2022
    983f4da
  12. compiler-errors commented on Aug 26, 2022

    @compiler-errors
    Contributor

    This apparently was not fixed.

  13. weiznich commented on Aug 27, 2022

    @weiznich
    ContributorAuthor

    I can confirm that this is fixed for rustc 1.65.0-nightly (c07a8b4e0 2022-08-26). Thank you all for the fast fix 🎉

  14. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on May 16, 2023
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

    No branches or pull requests

    Issue actions