cargo doc --open always respect request_kind#11804
cargo doc --open always respect request_kind#118040xPoe wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
0xPoe
left a comment
There was a problem hiding this comment.
This PR still working in the process. I'll add a test later.
|
My suggestion would be to have the following behavior:
This may require extending the |
4f08041 to
1adb8c1
Compare
How does it interact with
|
It depends, but for the most part the code should not know or care about forced-target. If there is only one root unit, then that's the one that gets opened (whether it is forced-target or not). If there are multiple, such as in a workspace, and one of those is forced-target and the other is not, then it will open the one that is not forced-target. As for the "first" entry, that is completely arbitrary, and is currently alphabetical I believe. The operation should be relatively simple, I think it would be something like: root_units.iter().find(|unit| unit.kind == requested_kind).next().unwrap_or(root_units[0]);That's a very rough sketch, but the general shape of what I think it should look like. |
181c726 to
83863ea
Compare
cargo doc --open respect forced-target|
@rustbot author |
d85b7a3 to
681e938
Compare
681e938 to
eb8be9d
Compare
|
@rustbot ready |
|
@ehuss Do you have any suggestion about which target I should use in the test on the stable channel? Thanks! |
|
The cargo testsuite has various things to help with cross-compiling. At the start of the function, write: if cross_compile::disabled() {
return;
}Then, for the target value, use |
eb8be9d to
6cd42f8
Compare
Thanks for your help! It works. |
|
Hi, just to confirm, |
Yes. |
2f31cd6 to
7f90e71
Compare
7f90e71 to
a9847e2
Compare
Added |
|
In thinking about this more, I came up with a concern with this approach, to be followed up at #11728 (comment). |
|
@rustbot blocked |
|
@ehuss What should I do to help this PR move forward? Do you think we still need to wait for more discussion about this behavior? |
|
☔ The latest upstream changes (presumably #12252) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (possibly 081d7ba) made this pull request unmergeable. Please resolve the merge conflicts. |
What does this PR try to resolve?
closes #11728
More details:
The open behavior is as follows:
cargo doc --open:
cargo doc --target TARGET --open:
How should we test and review this PR?
See the unit test.