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 29 pull requests #56325

Closed
wants to merge 79 commits into from
Closed

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Nov 28, 2018

Successful merges:

Failed merges:

r? @ghost

matthiaskrgr and others added 30 commits October 27, 2018 11:55
Remove the parts of atomic::Ordering's intro that wrongly claimed that
SeqCst prevents all reorderings around it.

Closes rust-lang#55196
Given the function

fn foo((_x, _): (LogDrop, LogDrop), (_, _y): (LogDrop, LogDrop)) {}

Prior to 1.12 we dropped both `_x` and `_y` before the rest of their
respective parameters, since then we dropped `_x` and `_y` after. The
original order appears to be the correct order, as the value created
later is dropped first, so we revert to that order and add a test for
it.
This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.
This makes the error style consistent with the convention in error messages.
The std::io::read main documentation can lead to error because the
buffer is prefilled with 10 zeros that will pad the response.
Using an empty vector is better.

The `read_to_end` documentation is already correct though.

This is my first rust PR, don't hesitate to tell me if I did something
wrong.
Instead of maybe storing its own sysroot and maybe deferring to the one
in `Session::opts`, just clone the latter when necessary so one is
always directly available. This removes the need for the getter.
`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.
It's more idiomatic, makes the code shorter, and will help with the next
commit.
`FileSearch::search()` traverses one or more directories. For each
directory it generates a `Vec<PathBuf>` containing one element per file
in that directory.

In some benchmarks this occurs enough that the allocations done for the
`PathBuf`s are significant, and in practice a small number of
directories are being traversed over and over again. For example, when
compiling the `tokio-webpush-simple` benchmark, two directories are
traversed 58 times each. Each of these directories have more than 100
files.

This commit changes things so that all the `Vec<PathBuf>`s that will be
needed by a `Session` are precomputed when that `Session` is created;
they are stored in `SearchPath`. `FileSearch` gets a reference to the
necessary `SearchPath`s. This reduces instruction counts on several
benchmarks by 1--5%.

The commit also removes the barely-used `visited_dirs` hash in
`for_each_lib_searchPath`. It only detects if `tlib_path` is the same as
one of the previously seen paths, which is unlikely.
Returning an iterator leads to nicer code all around.
Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.

To address this issue, I removed that inner function.
Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer

I was confused by this API so I clarified what they are doing.

I was wondering if I should try to unify more documentation and examples between `unix` and `linux` (e.g. “of the file” is used in `unix` to refer to the file these metadata is for, “of this file” in `linux`, “of the underlying file” in `std::fs::File`).
…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.
…ikomatsakis

Suggest appropriate place for lifetime when declared after type arguments
…r=wesleywiser

Make JSON output from -Zprofile-json valid

r? @wesleywiser

cc rust-lang/rustc-perf#299
…cramertj

Remove unsafe `unsafe` inner function.

Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.

To address this issue, I removed that inner function.
…lexcrichton

Stabilize feature `macro_at_most_once_rep`

a.k.a. `?` Kleene operator 🎉

cc rust-lang#48075

r? @Centril
…aelwoerister

Update outdated code comments in StringReader

For the detection of newlines in the lexer, this is now done in `analyze_source_file.rs`.
…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%.
move stage0.txt to toplevel directory

This way all files needed by packagers now reside in toplevel
Fix small typo in comment of thread::stack_size
Fix a typo in the documentation of std::ffi
Fix alignment of stores to scalar pair

The alignment for the second element of a scalar pair is not the same as for the first element, make sure it is calculated correctly. This fixes rust-lang#56267.

r? @eddyb
@pietroalbini pietroalbini changed the title Rollup of 31 pull requests Rollup of 29 pull requests Nov 28, 2018
@pietroalbini
Copy link
Member Author

@bors r+ p=29

@bors
Copy link
Contributor

bors commented Nov 28, 2018

📌 Commit a6e3e85 has been approved by pietroalbini

@bors
Copy link
Contributor

bors commented Nov 28, 2018

⌛ Testing commit a6e3e85 with merge 95a27089df607f5c8e111fd31f3083da80eb6bad...

@bors
Copy link
Contributor

bors commented Nov 29, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-distcheck 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:00:00] rm 'src/tools/lldb'
[00:00:00] Attempting with retry: sh -c rm -f download-src-tools-lldb.tar.gz &&         curl -sSL -o download-src-tools-lldb.tar.gz https://github.com/rust-lang-nursery/lldb/archive/fdea743be550ed8d7b61b2c908944cdd1290a6ad.tar.gz
[00:00:00] rm 'src/tools/clang'
[00:00:00] Attempting with retry: sh -c rm -f download-src-tools-clang.tar.gz &&         curl -sSL -o download-src-tools-clang.tar.gz https://github.com/rust-lang-nursery/clang/archive/d0fc1788123de9844c8088b977cd142021cea1f2.tar.gz
[00:00:00] Attempting with retry: sh -c git submodule deinit -f  src/tools/rust-installer src/liblibc src/doc/nomicon src/tools/cargo src/doc/reference src/tools/rls src/libcompiler_builtins src/tools/clippy src/tools/rustfmt src/tools/miri src/dlmalloc src/stdsimd src/libbacktrace src/doc/rustc-guide &&     git submodule sync &&     git submodule update -j 16 --init --recursive  src/tools/rust-installer src/liblibc src/doc/nomicon src/tools/cargo src/doc/reference src/tools/rls src/libcompiler_builtins src/tools/clippy src/tools/rustfmt src/tools/miri src/dlmalloc src/stdsimd src/libbacktrace src/doc/rustc-guide
[00:00:00] Cleared directory 'src/doc/nomicon'
[00:00:00] Cleared directory 'src/doc/reference'
[00:00:00] Cleared directory 'src/doc/rustc-guide'
[00:00:00] Cleared directory 'src/libbacktrace'
---
[00:00:00] Cleared directory 'src/tools/rustfmt'
[00:00:00] Submodule 'src/dlmalloc' (https://github.com/alexcrichton/dlmalloc-rs.git) registered for path 'src/dlmalloc'
[00:00:00] Submodule 'src/doc/nomicon' (https://github.com/rust-lang-nursery/nomicon.git) registered for path 'src/doc/nomicon'
[00:00:00] Submodule 'src/doc/reference' (https://github.com/rust-lang-nursery/reference.git) registered for path 'src/doc/reference'
[00:00:00] Submodule 'src/doc/rustc-guide' (https://github.com/rust-lang/rustc-guide.git) registered for path 'src/doc/rustc-guide'
[00:00:00] Submodule 'src/libcompiler_builtins' (https://github.com/rust-lang-nursery/compiler-builtins.git) registered for path 'src/libcompiler_builtins'
[00:00:00] Submodule 'src/liblibc' (https://github.com/rust-lang/libc.git) registered for path 'src/liblibc'
[00:00:00] Submodule 'src/stdsimd' (https://github.com/rust-lang-nursery/stdsimd.git) registered for path 'src/stdsimd'
[00:00:00] Submodule 'src/tools/cargo' (https://github.com/rust-lang/cargo.git) registered for path 'src/tools/cargo'
---
[00:00:01] Cloning into '/home/travis/build/rust-lang/rust/src/tools/rust-installer'...
[00:00:01] Cloning into '/home/travis/build/rust-lang/rust/src/doc/reference'...
[00:00:02] Cloning into '/home/travis/build/rust-lang/rust/src/libbacktrace'...
[00:00:02] Cloning into '/home/travis/build/rust-lang/rust/src/libcompiler_builtins'...
[00:00:02] Cloning into '/home/travis/build/rust-lang/rust/src/doc/rustc-guide'...
[00:00:02] Cloning into '/home/travis/build/rust-lang/rust/src/liblibc'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/tools/miri'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/tools/rustfmt'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/stdsimd'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/stdsimd'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/tools/clippy'...
[00:00:06] Cloning into '/home/travis/build/rust-lang/rust/src/tools/cargo'...
[00:00:06] Submodule path 'src/dlmalloc': checked out 'c99638dc2ecfc750cc1656f6edb2bd062c1e0981'
[00:00:06] Submodule path 'src/doc/nomicon': checked out 'f8a4e96feb2e5a6ed1ef170ad40e3509a7755cb4'
[00:00:06] Submodule path 'src/doc/reference': checked out '60077efda319c95a89fe39609803c5433567adbf'
[00:00:07] Submodule path 'src/doc/rustc-guide': checked out '3a804956e3c28d7e44e38804207a00013594e1d3'
[00:00:07] Submodule path 'src/libcompiler_builtins': checked out 'fe74674f6e4be76d47b66f67d529ebf4186f4eb1'
[00:00:07] Submodule 'compiler-rt' (https://github.com/rust-lang/compiler-rt) registered for path 'src/libcompiler_builtins/compiler-rt'
[00:00:07] Submodule 'libm' (https://github.com/rust-lang-nursery/libm) registered for path 'src/libcompiler_builtins/libm'
[00:00:07] Cloning into '/home/travis/build/rust-lang/rust/src/libcompiler_builtins/compiler-rt'...
---
[00:12:07] configure: 
[00:12:07] configure: run `python /checkout/obj/build/tmp/distcheck/x.py --help`
[00:12:07] configure: 
[00:12:07] Traceback (most recent call last):
[00:12:07]   File "/checkout/obj/build/tmp/distcheck/src/bootstrap/bootstrap.py", line 870, in <module>
[00:12:07]     main()
[00:12:07]   File "/checkout/obj/build/tmp/distcheck/src/bootstrap/bootstrap.py", line 853, in main
[00:12:07]     bootstrap(help_triggered)
[00:12:07]   File "/checkout/obj/build/tmp/distcheck/src/bootstrap/bootstrap.py", line 810, in bootstrap
[00:12:07]     data = stage0_data(build.rust_root)
[00:12:07]   File "/checkout/obj/build/tmp/distcheck/src/bootstrap/bootstrap.py", line 158, in stage0_data
[00:12:07]     with open(nightlies, 'r') as nightlies:
[00:12:07] IOError: [Errno 2] No such file or directory: '/checkout/obj/build/tmp/distcheck/stage0.txt'
[00:12:07] Makefile:58: recipe for target 'check' failed
[00:12:07] make: *** [check] Error 1
[00:12:07] 
[00:12:07] 
[00:12:07] command did not execute successfully: "make" "check"
[00:12:07] 
[00:12:07] 
[00:12:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test distcheck
[00:12:07] Build completed unsuccessfully in 0:09:44
---
travis_time:end:14591410:start=1543449932851960196,finish=1543449932859589395,duration=7629199
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:07c89e64
$ 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:05c21f7f
travis_time:start:05c21f7f
$ 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:0c48ebe8
$ 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)

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

bors commented Nov 29, 2018

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

@pietroalbini pietroalbini deleted the rollup branch November 29, 2018 14:28
@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.

None yet