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

Fix rustdoc ICE for impl trait in argument position #50366

Conversation

GuillaumeGomez
Copy link
Member

Fixes #50358.

Weirdest fix ever...

r? @QuietMisdreavus

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

[00:05:12] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:05:12] tidy error: /checkout/src/test/rustdoc/ice-impl-trait-arg-position.rs:17: line longer than 100 chars
[00:05:12] tidy error: /checkout/src/test/rustdoc/ice-impl-trait-arg-position.rs:18: line longer than 100 chars
[00:05:14] some tidy checks failed
[00:05:14] 
[00:05:14] 
[00:05:14] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:14] 
[00:05:14] 
[00:05:14] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:14] Build completed unsuccessfully in 0:02:09
[00:05:14] Build completed unsuccessfully in 0:02:09
[00:05:14] Makefile:79: recipe for target 'tidy' failed
[00:05:14] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00b1e897
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez GuillaumeGomez force-pushed the fix-rustdoc-ice-impl-trait-argument-position branch from cfaf21c to 02f7524 Compare May 1, 2018 22:42
@KodrAus
Copy link
Contributor

KodrAus commented May 1, 2018

Now I don't feel so bad about making that exact same 'fix' in a local build so I could see my docs...

@GuillaumeGomez
Copy link
Member Author

Then you did well. I really wonder why this assert was there...

@QuietMisdreavus
Copy link
Member

I think the assumption behind that assert was that the closure passed to enter_impl_trait would clear out the cx.impl_trait_bounds map. If this assertion is being hit, i wonder if there's a pass somewhere that's not fully processing these bounds before they're getting dropped.

With this assertion removed, how does the documentation look for the included test? I'm curious whether it includes the impl Read deep in the bound there.

@GuillaumeGomez
Copy link
Member Author

It does generate the documentation as expected. Which is why I wondered why such an assert was there...

@QuietMisdreavus
Copy link
Member

It looks like the line (and function) in question was added in #49304 - @sinkuu, do you remember why you added this assert! in that PR? It's causing an ICE in the test that was added in this PR, and we're wondering what it's meant to catch.

@sinkuu
Copy link
Contributor

sinkuu commented May 3, 2018

The assertion error is legit. In this case, impl Read is not resolved (link to trait definition is not available). We need to correctly handle a synthesized type-parameter referring another.

@QuietMisdreavus
Copy link
Member

Since @sinkuu opened #50419 with a proper fix, and incorporated the test from this PR, i'm closing this in favor of that one.

bors added a commit that referenced this pull request May 5, 2018
…eavus

rustdoc: Resolve nested `impl Trait`s

Fixes #50358.

Populates `cx.impl_trait_bounds` incrementally while `clean`ing generic params, so that a synthetic type-parameter can refer to previous ones.

cc #50366
@GuillaumeGomez GuillaumeGomez deleted the fix-rustdoc-ice-impl-trait-argument-position branch May 5, 2018 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc panic while documenting impl trait in argument position
5 participants