-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 regression (overflow evaluating the requirement …) #79459
Comments
Side question: Can we add diesel to rust test suite? |
This also happens when documenting a crate with It's caused by this code in rustdoc: rust/src/librustdoc/clean/mod.rs Lines 1511 to 1518 in 361543d
When we call |
Backtrace
So we need to change
not to abort. This comment was added in 8bd8466: rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs Lines 171 to 176 in 361543d
@nikomatsakis would it maybe be possible for the caller to say whether it wants to abort or not? |
Actually I guess the issue is that the type length limit code shouldn't be called at all, otherwise it will still emit an error even if it doesn't abort. |
I guess in the meantime #77467 should probably be reverted :( |
@jyn514: Simply disabling the I think one solution would be to run the normalization in |
As a side note, this ended up putting the CI workflow for https://github.com/rust-lang/cargo in a broken state, as this overflow occurs when trying to document If we have the CI budget, I think it would be a good idea to generate (but not upload) the docs for tools, to ensure that this kind of problem can't happen again. |
Assigning |
@Aaron1011 it looks like it's already run in canonical mode:
|
Confusing, there are two unrelated kinds of 'canonical' things involved here. One is 'query canonicalization', which involves the wrapping In this case, what we need is
which sets the mode to rust/compiler/rustc_trait_selection/src/traits/select/mod.rs Lines 213 to 223 in 774bce7
|
@Aaron1011 unfortunately, that didn't help, this still fails with the same error: diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index 5b31998b7d3..8a78fa96d53 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -218,7 +218,7 @@ pub fn new(infcx: &'cx InferCtxt<'cx, 'tcx>) -> SelectionContext<'cx, 'tcx> {
intercrate: false,
intercrate_ambiguity_causes: None,
allow_negative_impls: false,
- query_mode: TraitQueryMode::Standard,
+ query_mode: TraitQueryMode::Canonical,
}
}
|
A slightly smaller reproduction (playground): #![feature(no_core)]
#![no_core]
pub trait AsQuery {
type Query;
}
impl<T> AsQuery for T {
type Query = usize;
}
pub trait SelectDsl {
type Output;
}
impl<T> SelectDsl for T
where
T: AsQuery,
// comment this out to get the same error in rustc ...
T::Query: SelectDsl,
{
type Output = <T::Query as SelectDsl>::Output;
}
pub type Select<Source> = <Source as SelectDsl>::Output;
// ... or uncomment this to get the same error
//pub struct S(Select<usize>); |
…jyn514 Revert "Normalize `<X as Y>::T` for rustdoc" Reverts rust-lang#77467 by disabling normalization. See rust-lang#79459; I intend to reland normalization once that's fixed. r? `@Aaron1011` cc `@oli-obk` `@GuillaumeGomez`
This was 'fixed' by #79469. |
…illaumeGomez Add -Z normalize-docs and enable it for compiler docs Works around rust-lang#79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195). This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack. Addresses rust-lang#77459.
…illaumeGomez Add -Z normalize-docs and enable it for compiler docs Works around rust-lang#79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195). This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack. Addresses rust-lang#77459.
This was proposed in rust-lang#79459 and rust-lang#79560. Diesel stresses the trait system implementation quite a lot and there have been various regressions regarding that in the past.
Code
I tried this code:
I expected to see this happen:
cargo doc --no-deps
succeedsInstead, this happened: Running
cargo doc --no-deps
failed with the following error message:(Note that compiling/checking that code via
cargo run
/cargo check
will just work fine)Version it worked on
It most recently worked on:
rustdoc 1.50.0-nightly (b48cafd9e 2020-11-25)
Version with regression
rustdoc --version
:If you know when this regression occurred, please add a line like below, replacing
{channel}
with one of stable, beta, or nightly.@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
The text was updated successfully, but these errors were encountered: