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

Use a function to access the Hir map to be able to turn it into a query later #56502

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Dec 4, 2018

r? @eddyb

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

The job x86_64-gnu-llvm-5.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:02ce7dec:start=1543927771956780303,finish=1543927773346930256,duration=1390149953
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---

[00:03:33] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:34] tidy error: /checkout/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs:229: line longer than 100 chars
[00:03:34] tidy error: /checkout/src/librustc_privacy/lib.rs:384: line longer than 100 chars
[00:03:34] tidy error: /checkout/src/librustc_privacy/lib.rs:395: line longer than 100 chars
[00:03:35] some tidy checks failed
[00:03:35] 
[00:03:35] 
[00:03:35] 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:03:35] 
[00:03:35] 
[00:03:35] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:35] Build completed unsuccessfully in 0:00:55
[00:03:35] Build completed unsuccessfully in 0:00:55
[00:03:35] make: *** [tidy] Error 1
[00:03:35] Makefile:79: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:011aae54
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Dec  4 12:53:17 UTC 2018
---
travis_time:end:049f65ba:start=1543927998009593717,finish=1543927998014769662,duration=5175945
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0e4cdd72
$ 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:1b57c870
travis_time:start:1b57c870
$ 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:12bd0eff
$ 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)

@eddyb
Copy link
Member

eddyb commented Dec 4, 2018

This PR LGTM as-is (cc @nikomatsakis @michaelwoerister).


FWIW, what I was envisioning long-term, would be something like tcx.hir(def_id) that gave you the HIR tree that owns that DefId (ideally that'd be 1:1, but we have more DefIds than ItemLocalId owners), and within which ItemLocalId could be used (which I'd call DefLocalHirId).

That is, everything would start from a DefId, whether it has a context to keep track of the "local HIR" it's in, or not, and we wouldn't expose the CrateNum/DefIndex distinction too much.

Among other things, this would allow us to avoid keeping the entire HIR in-memory all the time.

@bors
Copy link
Contributor

bors commented Dec 4, 2018

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

@oli-obk
Copy link
Contributor

oli-obk commented Dec 6, 2018

Discussed in compiler meeting, no complaints, only cheering.

So I guess r=eddyb after a rebase

@oli-obk
Copy link
Contributor

oli-obk commented Dec 6, 2018

@bors p=1 super bitrotty PR

@oli-obk oli-obk 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 Dec 6, 2018
@Zoxc
Copy link
Contributor Author

Zoxc commented Dec 6, 2018

Protip for @rust-lang/dev-tools, search and replace tcx.hir with tcx.hir() =P

@Zoxc
Copy link
Contributor Author

Zoxc commented Dec 7, 2018

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Dec 7, 2018

📌 Commit a70babe 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 Dec 7, 2018
bors added a commit that referenced this pull request Dec 7, 2018
Use a function to access the Hir map to be able to turn it into a query later

r? @eddyb
@bors
Copy link
Contributor

bors commented Dec 7, 2018

⌛ Testing commit a70babe with merge 4a45578...

@bors
Copy link
Contributor

bors commented Dec 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 4a45578 to master...

@bors bors merged commit a70babe into rust-lang:master Dec 7, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #56502!

Tested on commit 4a45578.
Direct link to PR: #56502

💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 miri on windows: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Dec 7, 2018
Tested on commit rust-lang/rust@4a45578.
Direct link to PR: <rust-lang/rust#56502>

💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 miri on windows: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 8, 2018
phansch pushed a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 8, 2018
phansch added a commit to rust-lang/rust-clippy that referenced this pull request Dec 8, 2018
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 8, 2018
Changes:
````
s/rustfmt-preview/rustfmt/
Swap if branches
Fix c_void false positive caused by libc refactoring
rustup rust-lang#56502 ( .hir -> .hir() )
typo: emum → enum
Fix format.
Add sysroot gettinh code to dogfood tests.
Add sysroot getting code to tests.
Don't try to determine sysroot. rustc_driver will use default value.
Fix suggestion for multiple derefs
Fix `clone_on_copy` not detecting derefs sometimes
````
bors added a commit that referenced this pull request Dec 9, 2018
submodules: update clippy from 1df5766 to a3c77f6

fixes clippy toolstate

Changes:
````
s/rustfmt-preview/rustfmt/
Swap if branches
Fix c_void false positive caused by libc refactoring
rustup #56502 ( .hir -> .hir() )
typo: emum → enum
Fix format.
Add sysroot gettinh code to dogfood tests.
Add sysroot getting code to tests.
Don't try to determine sysroot. rustc_driver will use default value.
Fix suggestion for multiple derefs
Fix `clone_on_copy` not detecting derefs sometimes
````
r? @oli-obk
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
s/rustfmt-preview/rustfmt/
Swap if branches
Fix c_void false positive caused by libc refactoring
rustup rust-lang/rust#56502 ( .hir -> .hir() )
typo: emum → enum
Fix format.
Add sysroot gettinh code to dogfood tests.
Add sysroot getting code to tests.
Don't try to determine sysroot. rustc_driver will use default value.
Fix suggestion for multiple derefs
Fix `clone_on_copy` not detecting derefs sometimes
````
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.

5 participants