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

Support `impl Trait` in inlined documentation #61613

Open
wants to merge 7 commits into
base: master
from

Conversation

@sinkuu
Copy link
Contributor

commented Jun 7, 2019

impl Trait in argument position was not properly rendered when inlined from other crates. (a live example on docs.rs)

old

new

@sinkuu sinkuu force-pushed the sinkuu:impl_trait_inline branch from ce7c59c to 7844ce4 Jun 7, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:0efa6ae3:start=1559894987881585530,finish=1559894988615283313,duration=733697783
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---

[00:04:17] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:18] tidy error: /checkout/src/librustdoc/clean/mod.rs:1702: line longer than 100 chars
[00:04:22] some tidy checks failed
[00:04:22] 
[00:04:22] 
[00:04:22] 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:04:22] 
[00:04:22] 
[00:04:22] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:22] Build completed unsuccessfully in 0:01:11
---
travis_time:end:01252620:start=1559895263298385339,finish=1559895263303144686,duration=4759347
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0af192c8
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:10f347cc
travis_time:start:10f347cc
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0019eb18
$ dmesg | grep -i kill

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)

@sinkuu sinkuu force-pushed the sinkuu:impl_trait_inline branch from 7844ce4 to 6129d61 Jun 7, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2019

☔️ The latest upstream changes (presumably #60293) made this pull request unmergeable. Please resolve the merge conflicts.

@sinkuu sinkuu force-pushed the sinkuu:impl_trait_inline branch from 6129d61 to ecda335 Jun 21, 2019

@ollie27
Copy link
Contributor

left a comment

Sorry for the late review.

Even with the (i as u32) -> param.index change I suggested there is still a problem with things like pub fn h(_x: impl Iterator<Item = u8>) {}, they render as:
image
The issue is that rustdoc uses simplify::where_clauses to convert the equality predicates into type bindings so that needs to be run before moving where predicates that are actually part of impl traits into cx.impl_trait_bounds. We could leave fixing this to a follow up PR though.

Show resolved Hide resolved src/librustdoc/clean/mod.rs Outdated
Show resolved Hide resolved src/test/rustdoc/inline_cross/impl_trait.rs Outdated
Show resolved Hide resolved src/test/rustdoc/inline_cross/impl_trait.rs Outdated
@ollie27

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

Looks good, thanks!

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

📌 Commit ea3e804 has been approved by ollie27

Centril added a commit to Centril/rust that referenced this pull request Jul 8, 2019

@Centril Centril referenced this pull request Jul 8, 2019

Closed

Rollup of 4 pull requests #62509

bors added a commit that referenced this pull request Jul 9, 2019

Auto merge of #62509 - Centril:rollup-lod7gdi, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #61613 (Support `impl Trait` in inlined documentation)
 - #62090 (typeck: merge opaque type inference logic)
 - #62403 (Replace SliceConcatExt trait with inherent methods and SliceConcat helper trait)
 - #62494 (Remove unused dependencies)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

⌛️ Testing commit ea3e804 with merge 0ab453a...

bors added a commit that referenced this pull request Jul 9, 2019

@Centril

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

Failed in #62509 (comment), @bors r-

@Centril

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

@bors retry

@sinkuu sinkuu force-pushed the sinkuu:impl_trait_inline branch from ea3e804 to 2cf5a9e Jul 9, 2019

@sinkuu

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

I guess test failure on one platform was caused by indeterminism of HashMap iteration, so I changed it to use BTreeMap (param-index order should be ok).
Also a drive-by fix for ICE with impl Trait in type bounds.

@sinkuu

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

@ollie27 Could you re-approve?

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2019

☔️ The latest upstream changes (presumably #63471) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon

This comment has been minimized.

Copy link

commented Aug 17, 2019

Ping from triage
@sinkuu - can you please fix the merge conflict so that @ollie27 can re-review?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.