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

Remove rustdoc-specific is_import field from HIR #51288

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

Mark-Simulacrum
Copy link
Member

Fixes #47100.

I believe that there is no need to check for the name being the same, as this
part of rustdoc seems to be strictly interested in exploring "public modules."
Re-exports from the same module cannot visit another module; and, re-exports
cannot export items with a greater visibility than that item declares.
Therefore, I think this code is either sufficient, or in fact does more than
is necessary, depending on whether rustdoc cares about the re-export itself.

r? @eddyb

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2018
@eddyb
Copy link
Member

eddyb commented Jun 2, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jun 2, 2018

📌 Commit 7bf908a has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2018
@bors
Copy link
Contributor

bors commented Jun 2, 2018

⌛ Testing commit 7bf908a with merge bf10fac...

bors added a commit that referenced this pull request Jun 2, 2018
Remove rustdoc-specific is_import field from HIR

Fixes #47100.

I believe that there is no need to check for the name being the same, as this
part of rustdoc seems to be strictly interested in exploring "public modules."
Re-exports from the same module cannot visit another module; and, re-exports
cannot export items with a greater visibility than that item declares.
Therefore, I think this code is either sufficient, or in fact does more than
is necessary, depending on whether rustdoc cares about the re-export itself.

r? @eddyb
@bors
Copy link
Contributor

bors commented Jun 2, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 2, 2018
@rust-highfive

This comment has been minimized.

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2018
@Mark-Simulacrum
Copy link
Member Author

I can't reproduce locally; repushed a rebased version. @bors r=eddyb

@bors
Copy link
Contributor

bors commented Jun 2, 2018

📌 Commit 0aa7784 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 2, 2018
@bors
Copy link
Contributor

bors commented Jun 3, 2018

⌛ Testing commit 0aa778427d8ea8840b46f862e42e0a5b00c9e784 with merge ecca3d484c50817a4db80ad28c9f8e8edc56ce75...

@bors
Copy link
Contributor

bors commented Jun 3, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 3, 2018
@rust-highfive

This comment has been minimized.

@kennytm
Copy link
Member

kennytm commented Jun 3, 2018

@bors retry travis-ci/travis-ci#9696

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2018
@bors
Copy link
Contributor

bors commented Jun 3, 2018

⌛ Testing commit 0aa778427d8ea8840b46f862e42e0a5b00c9e784 with merge 3998a03c521b5b10d938de48f5c0b8f24135db30...

@bors
Copy link
Contributor

bors commented Jun 3, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 3, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-nopt 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.
[01:11:47] failures:
[01:11:47] 
[01:11:47] ---- [rustdoc] rustdoc/universal-impl-trait.rs stdout ----
[01:11:47] 
[01:11:47] error: htmldocck failed!
[01:11:47] status: exit code: 1
[01:11:47] command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/universal-impl-trait" "/checkout/src/test/rustdoc/universal-impl-trait.rs"
[01:11:47] ------------------------------------------
[01:11:47] 
[01:11:47] ------------------------------------------
[01:11:47] stderr:
[01:11:47] stderr:
[01:11:47] ------------------------------------------
[01:11:47] 46: @matches check failed
[01:11:47]  `PATTERN` did not match
[01:11:47]      // @matches - 'trait\.Read\.html'
[01:11:47] 58: @matches check failed
[01:11:47]  `PATTERN` did not match
[01:11:47]  // @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
[01:11:47] Encountered 2 errors
[01:11:47] 
[01:11:47] ------------------------------------------
[01:11:47] 
---
[01:11:47] test result: FAILED. 233 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out
[01:11:47] 
[01:11:47] 
[01:11:47] 
[01:11:47] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options " "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "6.0.1\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:11:47] 
[01:11:47] 
[01:11:47] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:11:47] Build completed unsuccessfully in 0:13:29
[01:11:47] Build completed unsuccessfully in 0:13:29
[01:11:47] make: *** [check] Error 1
[01:11:47] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0080291a
$ 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)

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2018
@rust-lang rust-lang deleted a comment from rust-highfive Jun 3, 2018
@rust-lang rust-lang deleted a comment from rust-highfive Jun 3, 2018
@rust-lang rust-lang deleted a comment from rust-highfive Jun 3, 2018
@Mark-Simulacrum
Copy link
Member Author

@eddyb I'm getting the impression that is_import didn't signify a re-export, rather, it's just "an import": for example, we should be true on something like use std::io::Read; even though there's no publicity involved. I think that's what is causing the test failure...

Any thoughts on what I should do in addition to the existing code? It's also not clear to me that we need a condition -- wouldn't we just visit more than necessary if there wasn't a condition?

@eddyb
Copy link
Member

eddyb commented Jun 3, 2018

@Mark-Simulacrum It wouldn't be listed in the exports if it were private, would it?

@@ -68,7 +68,8 @@ impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> {
}

for item in self.cx.tcx.item_children(def_id).iter() {
if !item.is_import || item.vis == Visibility::Public {
if self.cx.tcx.def_key(item.def.def_id()).parent.map_or(false, |d| d != def_id.index) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you have the condition inverted - !is_import means it was originally defined in that module, whereas d != def_id.index means the parent isn't the module itself, which means it was originally defined elsewhere.

@Mark-Simulacrum
Copy link
Member Author

@bors r=eddyb

Inverted the condition.

@bors
Copy link
Contributor

bors commented Jun 3, 2018

📌 Commit 19e0b7d has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 3, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jun 4, 2018
…=eddyb

Remove rustdoc-specific is_import field from HIR

Fixes rust-lang#47100.

I believe that there is no need to check for the name being the same, as this
part of rustdoc seems to be strictly interested in exploring "public modules."
Re-exports from the same module cannot visit another module; and, re-exports
cannot export items with a greater visibility than that item declares.
Therefore, I think this code is either sufficient, or in fact does more than
is necessary, depending on whether rustdoc cares about the re-export itself.

r? @eddyb
bors added a commit that referenced this pull request Jun 4, 2018
Rollup of 6 pull requests

Successful merges:

 - #51288 (Remove rustdoc-specific is_import field from HIR)
 - #51299 (const fn integer operations)
 - #51317 (Allow enabling incremental via config.toml)
 - #51323 (Generate br for all two target SwitchInts)
 - #51326 (Various minor slice iterator cleanups)
 - #51329 (Remove the unused `-Z trans-time-graph` flag.)

Failed merges:
@bors
Copy link
Contributor

bors commented Jun 4, 2018

⌛ Testing commit 19e0b7d with merge 6232478...

@bors bors merged commit 19e0b7d into rust-lang:master Jun 4, 2018
@bors
Copy link
Contributor

bors commented Jun 4, 2018

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 4, 2018
@Mark-Simulacrum Mark-Simulacrum deleted the delete-is-import branch June 8, 2019 13:51
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.

5 participants