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

Rustdoc fails to build diesel documentation on current nightly #100620

Closed
weiznich opened this issue Aug 16, 2022 · 8 comments · Fixed by #100705
Closed

Rustdoc fails to build diesel documentation on current nightly #100620

weiznich opened this issue Aug 16, 2022 · 8 comments · Fixed by #100705
Assignees
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@weiznich
Copy link
Contributor

weiznich commented Aug 16, 2022

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.

@weiznich weiznich added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Aug 16, 2022
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-untriaged Untriaged performance or correctness regression. labels Aug 16, 2022
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Aug 16, 2022

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
Copy link
Contributor Author

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
Copy link
Member

This is due to my PR. @rustbot claim

@GuillaumeGomez
Copy link
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
Copy link
Contributor Author

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

@apiraino apiraino added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 17, 2022
@compiler-errors
Copy link
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.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Aug 25, 2022
…i-obk

Avoid reporting overflow in `is_impossible_method`

Fixes rust-lang#100620

We're evaluating a new predicate in a different param-env than it was checked during typeck, so be more careful about handling overflow errors. Instead of using `FulfillmentCtxt`, using `InferCtxt::evaluate_obligation` by itself will give us back the overflow error, so we can throw it away properly.

This may give us more false-positives, but it doesn't regress the `<HashMap as Iterator>::rev` example that originally motivated adding `is_impossible_method` in the first place.
@bors bors closed this as completed in 983f4da Aug 26, 2022
@compiler-errors
Copy link
Member

This apparently was not fixed.

@weiznich
Copy link
Contributor Author

weiznich commented Aug 27, 2022

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

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants