-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 29 pull requests #56325
Conversation
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.
…-dereferencing" error
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)
Fix ICE with feature self_struct_ctor Fix rust-lang#56202.
…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`.
…atsakis rustc-guide has moved to rust-lang/ r? @nikomatsakis
…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%.
…ng-link, r=steveklabnik Add missing doc link r? @steveklabnik
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
@bors r+ p=29 |
📌 Commit a6e3e85 has been approved by |
⌛ Testing commit a6e3e85 with merge 95a27089df607f5c8e111fd31f3083da80eb6bad... |
💔 Test failed - status-travis |
The job Click to expand the log.
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 |
☔ The latest upstream changes (presumably #56300) made this pull request unmergeable. Please resolve the merge conflicts. |
Successful merges:
FileSearch
andSearchPaths
#56090 (OverhaulFileSearch
andSearchPaths
)unsafe
inner function. #56236 (Remove unsafeunsafe
inner function.)macro_at_most_once_rep
#56245 (Stabilize featuremacro_at_most_once_rep
)P
inInvocationCollector::fold_{,opt_}expr
. #56268 (Reuse theP
inInvocationCollector::fold_{,opt_}expr
.)Failed merges:
r? @ghost