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

Rollup of 11 pull requests #56353

Closed
wants to merge 26 commits into from
Closed

Conversation

pietroalbini
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

nnethercote and others added 26 commits November 20, 2018 20:55
This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.
`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists,
but not needing to dereference makes type inference easier
for example when using `u32::from_be_bytes`.

Also add doc examples doing just that.
This commit replaces many usages of `File::open` and reading or writing
with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code
complexity, and will improve performance for most reads, since the
functions allocate the buffer to be the size of the file.

I believe that this commit will not impact behavior in any way, so some
matches will check the error kind in case the file was not valid UTF-8.
Some of these cases may not actually care about the error.
`mir_stats` has not been used since 2b32cb9.
This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.
…oerister

Use sort_by_cached_key when the key function is not trivial/free

I'm not 100% sure about `def_path_hash` (everything it does is inlined) but it seems like a good idea at least for the rest, as they are cloning.
add test for issue rust-lang#21335

Running this test with LLVM assertions enabled doesn't seem to trigger an assertion on my Mac.

Fixes rust-lang#21335.
Assorted tweaks

- preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it)
- add a FIXME to `String::from_utf16`

r? @RalfJung
…komatsakis

drop glue takes in mutable references, it should reflect that in its type

When drop glue begins, it should retag, like all functions taking references do. But to do that, it needs to take the reference at a proper type: `&mut T`, not `*mut T`.

Failing to retag can mean that the memory the reference points to remains frozen, and `EscapeToRaw` on a frozen location is a NOP, meaning later mutations cause a Stacked Borrows violation.

Cc @nikomatsakis @gankro because Stacked Borrows
Cc @eddyb for the changes to miri argument passing (the intention is to allow passing `*mut [u8]` when `&mut [u8]` is expected and vice versa)
…ithoutboats

Add TryFrom<&[T]> for [T; $N] where T: Copy

`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`.

Also add doc examples doing just that.
…crum

use top level `fs` functions where appropriate

This commit replaces many usages of `File::open` and reading or writing
with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code
complexity, and will improve performance for most reads, since the
functions allocate the buffer to be the size of the file.

I believe that this commit will not impact behavior in any way, so some
matches will check the error kind in case the file was not valid UTF-8.
Some of these cases may not actually care about the error.
…r=petrochenkov

Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.

This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.
…excrichton

Remove not used option

`mir_stats` has not been used since 2b32cb9.
…-Simulacrum

Rename conversion util; remove duplicate util in librustc_codegen_llvm.
…ension, r=nagisa

rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker

Part of rust-lang#55396.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

r? @nagisa
cc @alexcrichton @japaric
@pietroalbini
Copy link
Member Author

@bors r+ p=12

@bors
Copy link
Contributor

bors commented Nov 29, 2018

📌 Commit 6c3a010 has been approved by pietroalbini

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 29, 2018
@bors
Copy link
Contributor

bors commented Nov 30, 2018

⌛ Testing commit 6c3a010 with merge 5f04ce828af40725ebaab47c3b2821ed8c8946bf...

@bors
Copy link
Contributor

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

The job wasm32-unknown 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:52:45] status: exit code: 2
[00:52:45] command: "make"
[00:52:45] stdout:
[00:52:45] ------------------------------------------
[00:52:45] echo 'fn main() {}' | LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/llvm-outputs/llvm-outputs:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' - --out-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/llvm-outputs/llvm-outputs/random_directory_that_does_not_exist_ir/ --emit=llvm-ir
[00:52:45] Makefile:4: recipe for target 'all' failed
[00:52:45] ------------------------------------------
[00:52:45] stderr:
[00:52:45] ------------------------------------------
[00:52:45] error[E0463]: can't find crate for `std`
[00:52:45] error[E0463]: can't find crate for `std`
[00:52:45] 
[00:52:45] error: aborting due to previous error
[00:52:45] 
[00:52:45] For more information about this error, try `rustc --explain E0463`.
[00:52:45] make: *** [all] Error 1
[00:52:45] ------------------------------------------
[00:52:45] 
[00:52:45] thread '[run-make] run-make/llvm-outputs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3250:9
[00:52:45] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:52:45] test result: FAILED. 9 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[00:52:45] 
[00:52:45] 
[00:52:45] 
[00:52:45] 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/wasm32-unknown-unknown/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-make" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make" "--stage-id" "stage2-wasm32-unknown-unknown" "--mode" "run-make" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:52:45] 
[00:52:45] 
[00:52:45] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/run-pass src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
[00:52:45] Build completed unsuccessfully in 0:50:22
---
travis_time:end:08b17ba8:start=1543543948506579809,finish=1543543948519040680,duration=12460871
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:06a76f1c
$ 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:077671ec
travis_time:start:077671ec
$ 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:08715ca7
$ 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)

@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup 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.