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

Reduce the number of clone()s needed in obligation_forest #52306

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Jul 12, 2018

Some can be avoided by using remove_entry instead of remove.

@rust-highfive
Copy link
Collaborator

r? @varkor

(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 Jul 12, 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.
[00:19:54]    Compiling rustc_asan v0.0.0 (file:///checkout/src/librustc_asan)
[00:19:55]    Compiling rustc_msan v0.0.0 (file:///checkout/src/librustc_msan)
[00:19:56]    Compiling rustc_tsan v0.0.0 (file:///checkout/src/librustc_tsan)
[00:19:56]    Compiling rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:19:58] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
[00:19:58] 
[00:19:58] error: internal compiler error: unexpected panic
[00:19:58] 
[00:19:58] 
[00:19:58] note: the compiler unexpectedly panicked. this is a bug.
[00:19:58] 
[00:19:58] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:19:58] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:19:58] 
[00:19:58] 
[00:19:58] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:19:58] 
[00:19:58] note: some of the compiler flags provided by cargo are hidden
[00:19:58] error: Could not compile `core`.
[00:19:58] 
[00:19:58] Caused by:
[00:19:58]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name core libcore/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=1cbcabaa1ea822b5 -C extra-filename=-1cbcabaa1ea822b5 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps` (exit code: 101)
[00:19:58]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name core libcore/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=1cbcabaa1ea822b5 -C extra-filename=-1cbcabaa1ea822b5 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps` (exit code: 101)
[00:19:58] warning: build failed, waiting for other jobs to finish...
[00:19:59] error: build failed
[00:19:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:19:59] expected success, got: exit code: 101
[00:19:59] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1117:9
[00:19:59] travis_fold:end:stage1-std

[00:19:59] travis_time:end:stage1-std:start=1531404199840154760,finish=1531404215303774964,duration=15463620204


[00:19:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:19:59] Build completed unsuccessfully in 0:16:13
[00:19:59] Makefile:28: recipe for target 'all' failed
[00:19:59] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1f5190b0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:24441ef8:start=1531404215840513787,finish=1531404215846402189,duration=5888402
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0178f6d4
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:04022fb8
$ 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)

@ljedrz ljedrz changed the title Remove an unnecessary clone() in obligation_forest Reduce the number of clone()s needed in obligation_forest Jul 12, 2018
if let Some((predicate, _)) = self.waiting_cache
.remove_entry(self.nodes[i].obligation.as_predicate())
{
self.done_cache.insert(predicate);
Copy link
Member

@varkor varkor Jul 13, 2018

Choose a reason for hiding this comment

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

Could you add a comment along the lines of // Avoid an extra clone() in this case., just to make clear that the two branches have the same behaviour?

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

r=me after the comment and squashing the two commits.

Some can be avoided by using remove_entry instead of remove.
@ljedrz ljedrz force-pushed the obligation_forest_clone branch from 31c1ffb to 384d04d Compare July 14, 2018 05:34
@ljedrz
Copy link
Contributor Author

ljedrz commented Jul 14, 2018

Squashed and commented.

@varkor
Copy link
Member

varkor commented Jul 16, 2018

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 16, 2018

📌 Commit 384d04d has been approved by varkor

@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 Jul 16, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jul 17, 2018
…arkor

Reduce the number of clone()s needed in obligation_forest

Some can be avoided by using `remove_entry` instead of `remove`.
bors added a commit that referenced this pull request Jul 17, 2018
Rollup of 9 pull requests

Successful merges:

 - #52286 (Deny bare trait objects in src/librustc_errors)
 - #52306 (Reduce the number of clone()s needed in obligation_forest)
 - #52338 (update miri)
 - #52385 (Pass edition flags to compiler from rustdoc as expected)
 - #52392 (AsRef doc wording tweaks)
 - #52430 (update nomicon)
 - #52434 (Enable incremental independent of stage)
 - #52435 (Calculate the exact capacity for 2 HashMaps)
 - #52446 (Block beta if clippy breaks.)

r? @ghost
@bors bors merged commit 384d04d into rust-lang:master Jul 17, 2018
@ljedrz ljedrz deleted the obligation_forest_clone branch July 17, 2018 15:50
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.

4 participants