-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE with rustdoc json backend #93588
Comments
Any news on this? I keep hitting this (with different types) on the current nightly ( |
I don't think this is a duplicate of either #83720 or #83057, because making all modules public and removing all git clone https://github.com/diesel-rs/diesel.git && cd diesel # commit 983209a61 for me
# Make all modules public
git ls-files | grep '\.rs' | xargs perl -pi -e 's/^ *mod /pub mod /'
# Undo partially to fix : error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`
git restore diesel_derives/src/lib.rs diesel_migrations/migrations_macros/src/lib.rs
# Remove all #[doc(inline)]
git ls-files | grep '\.rs$' | xargs perl -pi -e 's/.*#\[doc\(inline\)\]//' but I still get the same ICE as I get before my changes (in my case it is I have tried to debug this further, but no luck so far. I have tried to:
Maybe someone with better knowledge of diesel could help to reduce the code in diesel to a minimal example that can be used to reproduce and debug the ICE? Disclaimer: My methodology might be flawed, because I'm still no veteran when it comes to debugging problems like these. |
I figured out how to make rustdoc not cause an ICE when generating rustdoc JSON for the main crate diesel/diesel. Maybe this gives someone enough of a clue to figure out what is wrong? See https://github.com/Enselic/diesel/pull/1/files for the diff that makes rustdoc JSON work. For example, I had to change impl<T, ST> AsExpression<ST> for T
where
T: Expression<SqlType = ST>,
ST: SqlType + TypedExpressionType,
{
type Expression = Self;
fn as_expression(self) -> Self {
self
}
} to impl<T, ST> AsExpression<ST> for T
where
T: Expression<SqlType = ST>,
ST: SqlType + TypedExpressionType,
{
type Expression = T;
fn as_expression(self) -> T {
self
}
} This fixes the error where one instance of the item with the same ID contains I haven't yet figured out a minimal way to reproduce. When I rip out this code and put it in a minimal crate, there is no ICE. There is probably some complicated construct that is causing these problems. CC @aDotInTheVoid who usually is interested in rustdoc JSON stuff. |
Started a minification at https://github.com/aDotInTheVoid/diesel-93588, not made much progress. |
I just wanted to add an observation. One of causes of the ICEs is that the typedef item corresponding to So to fix this class of ICE problems, it should work to normalise the representation so that the two instance of the same typedef item is the same. This "trick" should in fact fix all cases of ICE in diesel/diesel that I pinpoint with https://github.com/Enselic/diesel/pull/1/files. Because in all cases it is about the same item having different but equivalent representations. Probably easier said than done to actually implement though... But maybe the code for this already exists for other uses somewhere in the compiler. |
Heads-up if you are debugging this via diesel: The project is (understandably) working around this bug by making local changes (see e.g. diesel-rs/diesel#3190 which was just merged), so to reproduce this problem with diesel, you need to remain on a commit before these changes. For example ecd22fbe38. |
@rustbot label -T-compiler +T-rustdoc |
I found at least one variant of a minimal reproducer: #97986 Not sure solving that will solve all of the ICEs we see with |
I found another minimal reproducer based on the diesel code base: #98547 With the (proposed) fix for that issue included in a rustdoc build, I get no ICE anymore with diesel/diesel, neither with diesel-rs/diesel@41404e6 nor with diesel-rs/diesel@ecd22fbe3. |
With latest nightly I do not get any ICEs any longer. So I think we can close this issue now, right? |
Regarding the E-needs-test label: I'm not sure what more tests to write? All relevant ICE fixes has already added regression tests to the best of my knowledge. Notably: |
Yeah, I think this can be closed |
Code
diesel-rs/diesel@41404e6 using the following command:
produces a internal compiler error inside of rustdoc
Meta
rustdoc +nightly --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: