Skip to content

Use crate name for reexported extern crate paths #51017

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

Merged
merged 2 commits into from
May 30, 2018

Conversation

estebank
Copy link
Contributor

Fix #43189.

@rust-highfive
Copy link
Contributor

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

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

estebank commented May 24, 2018

Tested locally with the ticket's repro, and it seems to be doing the right thing:

error[E0599]: no method named `a` found for type `()` in the current scope
 --> src/main.rs:3:16
  |
3 | fn main() { ().a(); }
  |                ^
  |
  = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
  |
3 | use b::a::A;
  |

Need to figure out what the appropriate way to test this is.

@pietroalbini
Copy link
Member

Ping from triage @michaelwoerister! This PR needs your review.

@michaelwoerister
Copy link
Member

Yes, a test would be great!

@pietroalbini pietroalbini 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 May 28, 2018
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 28, 2018
@estebank
Copy link
Contributor Author

Added test.

@michaelwoerister
Copy link
Member

Thanks @estebank!

@bors r+

@bors
Copy link
Collaborator

bors commented May 29, 2018

📌 Commit 43d863b has been approved by michaelwoerister

@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 May 29, 2018
@bors
Copy link
Collaborator

bors commented May 30, 2018

⌛ Testing commit 43d863b with merge 8a3b0e33872bfb091d6bf352d183104d2dff6b8c...

@bors
Copy link
Collaborator

bors commented May 30, 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 May 30, 2018
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-aux 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:47:21] 
[01:47:21] testing https://github.com/BurntSushi/xsv
[01:47:21] Initialized empty Git repository in /checkout/obj/build/ct/xsv/.git/
[01:47:21] fatal: Could not parse object '66956b6bfd62d6ac767a6b6499c982eae20a2c9f'.
[01:47:41] fatal: unable to access 'https://github.com/BurntSushi/xsv/': Could not resolve host: github.com
[01:47:41] thread 'main' panicked at 'assertion failed: status.success()', tools/cargotest/main.rs:128:13
[01:47:41] 
[01:47:41] 
[01:47:41] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/cargotest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/ct"
[01:47:41] expected success, got: exit code: 101
[01:47:41] expected success, got: exit code: 101
[01:47:41] 
[01:47:41] 
[01:47:41] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/test/pretty src/test/run-pass/pretty src/test/run-fail/pretty src/test/run-pass-valgrind/pretty src/test/run-pass-fulldeps/pretty src/test/run-fail-fulldeps/pretty src/tools/cargo src/tools/cargotest
[01:47:41] Build completed unsuccessfully in 0:44:32
[01:47:41] Makefile:60: recipe for target 'check-aux' failed
[01:47:41] make: *** [check-aux] Error 1

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

1 similar comment
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-aux 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:47:21] 
[01:47:21] testing https://github.com/BurntSushi/xsv
[01:47:21] Initialized empty Git repository in /checkout/obj/build/ct/xsv/.git/
[01:47:21] fatal: Could not parse object '66956b6bfd62d6ac767a6b6499c982eae20a2c9f'.
[01:47:41] fatal: unable to access 'https://github.com/BurntSushi/xsv/': Could not resolve host: github.com
[01:47:41] thread 'main' panicked at 'assertion failed: status.success()', tools/cargotest/main.rs:128:13
[01:47:41] 
[01:47:41] 
[01:47:41] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/cargotest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/ct"
[01:47:41] expected success, got: exit code: 101
[01:47:41] expected success, got: exit code: 101
[01:47:41] 
[01:47:41] 
[01:47:41] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/test/pretty src/test/run-pass/pretty src/test/run-fail/pretty src/test/run-pass-valgrind/pretty src/test/run-pass-fulldeps/pretty src/test/run-fail-fulldeps/pretty src/tools/cargo src/tools/cargotest
[01:47:41] Build completed unsuccessfully in 0:44:32
[01:47:41] Makefile:60: recipe for target 'check-aux' failed
[01:47:41] make: *** [check-aux] Error 1

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

@michaelwoerister
Copy link
Member

@bors retry

@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 May 30, 2018
@bors
Copy link
Collaborator

bors commented May 30, 2018

⌛ Testing commit 43d863b with merge 2408095...

bors added a commit that referenced this pull request May 30, 2018
Use crate name for reexported `extern crate` paths

Fix #43189.
@bors
Copy link
Collaborator

bors commented May 30, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing 2408095 to master...

@bors bors merged commit 43d863b into rust-lang:master May 30, 2018
@alexcrichton
Copy link
Member

FWIW it looks like this had a fairly negative impact on perf for a few benchmarks

@estebank
Copy link
Contributor Author

estebank commented Jun 1, 2018

@alexcrichton wow. Should we immediately revert this change? I'm surprised the performance regression is exclusively in nll-opt.

@michaelwoerister
Copy link
Member

I'm surprised this has any perf impact at all. original_crate_name is a trivial query, more or less just a hash table lookup. @rust-lang/wg-compiler-nll any ideas why this could affect NLL performance?

@michaelwoerister
Copy link
Member

http://perf.rust-lang.org/ shows a single NLL spike for this PR, then performance is immediately better again. Something might just have gone wrong with that performance measurement. I don't think this is something to worry about.

@alexcrichton
Copy link
Member

Oh sorry I just wanted to bring this up as an FYI, no need to immediately revert! I just figured it'd be good to track if there's an easy or "obviously available" solution.

@michaelwoerister it does indeed spike but I was suspicious of this comment because the commit afterwards was an explicit optimization for NLL. In that sense I thought this could be a regression followed immediately by an improvement and may still be worth looking into

@alexcrichton
Copy link
Member

One interesting test though would be to submit a try build of reverting this PR and if it shows a performance improvement across the benchmarks that may mean there's something to look into! If it shows no change, however (as expected), then it could safely be filed under "spurious bug"

@estebank estebank deleted the crate-name-in-path branch November 9, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants