master
Commits on Sep 28, 2020
-
Auto merge of #77265 - vandenheuvel:chalkup, r=Dylan-DPC
Update chalk to 0.29.0
-
Auto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrum
LVI hardening tests Mitigating the speculative execution LVI attack against SGX enclaves requires compiler changes (i.e., adding lfences). This pull requests adds various tests to check if this happens correctly.
-
Auto merge of #75295 - tmiasko:fds, r=Amanieu
Reopen standard file descriptors when they are missing on Unix The syscalls returning a new file descriptors generally return lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to stdin, sdout, or stderr. Previously when any of standard file descriptors has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} were likely to either succeed while being performed on unrelated file descriptor, or fail with EBADF which is silently ignored. Avoid the issue by using /dev/null as a replacement when the standard file descriptors are missing. The implementation is based on the one found in musl. It was selected among a few others on the basis of the lowest overhead in the case when all descriptors are already present (measured on GNU/Linux). Closes #57728. Closes #46981. Closes #60447. Benefits: * Makes applications robust in the absence of standard file descriptors. * Upholds IntoRawFd / FromRawFd safety contract (which was broken previously). Drawbacks: * Additional syscall during startup. * The standard descriptors might have been closed intentionally. * Requires /dev/null. Alternatives: * Check if stdin, stdout, stderr are opened and provide no-op substitutes in std::io::{stdin,stdout,stderr} without reopening them directly. * Leave the status quo, expect robust applications to reopen them manually.
Commits on Sep 27, 2020
-
Auto merge of #77242 - ecstatic-morse:dataflow-switch-int, r=jonas-sc…
…hievink Replace `discriminant_switch_effect` with more general version #68528 added a new edge-specific effect for `SwitchInt` terminators, `discriminant_switch_effect`, to the dataflow framework. While this accomplished the short-term goal of making drop elaboration more precise, it wasn't really useful in other contexts: It only supported `SwitchInt`s on the discriminant of an `enum` and did not allow effects to be applied along the "otherwise" branch. In const-propagation, for example, arbitrary edge-specific effects for the targets of a `SwitchInt` can be used to remember the value a `match` scrutinee must have in each arm. This PR replaces `discriminant_switch_effect` with a more general `switch_int_edge_effects` method. The new method has a slightly different interface from the other edge-specific effect methods (e.g. `call_return_effect`). This divergence is explained in the new method's documentation, and reading the changes to the various dataflow impls as well as `direction.rs` should further clarify things. This PR should not change behavior.
-
Reopen standard streams when they are closed on Unix
The syscalls returning a new file descriptors generally use lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to the standard streams. Previously when any of standard streams has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} objects were likely to operate on other logically unrelated file resources opened afterwards. Avoid the issue by reopening the standard streams when they are closed.Tomasz Miąsko committedSep 27, 2020 Loading status checks… -
Auto merge of #77229 - tmiasko:liveness, r=lcnr
Small improvements in liveness pass * Remove redundant debug logging (`add_variable` already contains logging). * Remove redundant fields for a number of live nodes and variables. * Delay conversion from a symbol to a string until linting. * Inline contents of specials struct. * Remove unnecessary local variable exit_ln. * Use newtype_index for Variable and LiveNode. * Access live nodes directly through self.lnks[ln]. No functional changes intended (except those related to the logging).
-
Auto merge of #77272 - jonas-schievink:rollup-dydo5kn, r=jonas-schievink
Rollup of 7 pull requests Successful merges: - #76839 (Add asm! support for MIPS) - #77203 (Check for missing const-stability attributes in `rustc_passes`) - #77249 (Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints) - #77252 (reduce overlong line) - #77256 (Fix typo in ExpnData documentation) - #77262 (Remove duplicate comment) - #77263 (Clean up trivial if let) Failed merges: r? `@ghost`
-
Rollup merge of #77263 - bugadani:cleanup, r=lcnr
Clean up trivial if let
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #77262 - bugadani:redundant-comment, r=Dylan-DPC
Remove duplicate comment
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #77256 - jyn514:typo, r=Aaron1011
Fix typo in ExpnData documentation This mis-highlighted the entire documentation as code: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.ExpnData.html#structfield.krate
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #77252 - tshepang:overlong, r=jyn514
reduce overlong line
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #77249 - jyn514:private-links, r=Manishearth
Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints This is not ideal because it means `deny(broken_intra_doc_links)` will no longer `deny(private_intra_doc_links)`. However, it can't be fixed with a new lint group, because `broken` is already in the `rustdoc` lint group; there would need to be a way to nest groups somehow. This also removes the early `return` so that the link will be generated even though it gives a warning. r? @Manishearth cc @ecstatic-morse (#77242 (comment))
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #77203 - ecstatic-morse:const-stability-attr-checks, …
…r=oli-obk Check for missing const-stability attributes in `rustc_passes` Currently, this happens as a side effect of `is_min_const_fn`, which is non-obvious. Also adds a test for this case, since we didn't seem to have one before.
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rollup merge of #76839 - lzutao:mips-asm, r=Amanieu
Add asm! support for MIPS For now, I only add support for mips32. mips64 may come in future PRs if I could learn more about the target.
jonas-schievink committedSep 27, 2020 Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Auto merge of #77259 - dgbo:master, r=kennytm
update stdarch submodule This commit update the src/stdarch submodule, we primarily want to include [rust-lang/stdarch#918 which provides prefetch hints for aarch64. This PR could deliver ~20% performance gain on our aarch64 server in Filecoin. Wish this could be used as soon as possible. Thanks.
-
-
Separate `private_intra_doc_links` and `broken_intra_doc_links` into …
…separate lints This is not ideal because it means `deny(broken_intra_doc_links)` will no longer `deny(private_intra_doc_links)`. However, it can't be fixed with a new lint group, because `broken` is already in the `rustdoc` lint group; there would need to be a way to nest groups somehow. This also removes the early `return` so that the link will be generated even though it gives a warning.
jyn514 committedSep 27, 2020 -
-
Auto merge of #77118 - exrook:stability-generic-parameters-2, r=varkor
Stability annotations on generic parameters (take 2.5) Rebase of #72314 + more tests Implements rust-lang/wg-allocators#2.
-
Auto merge of #71274 - RalfJung:raw-init-check-aggregate, r=petrochenkov
might_permit_raw_init: also check aggregate fields This is the next step for #66151: when doing `mem::zeroed`/`mem::uninitialized`, also recursively check fields of aggregates (except for arrays) for whether they permit zero/uninit initialization.
-
-
-
-
Auto merge of #76955 - jyn514:refactor-diagnostics, r=euclio
Refactor and fix intra-doc link diagnostics, and fix links to primitives Closes #76925, closes #76693, closes #76692. Originally I only meant to fix #76925. But the hack with `has_primitive` was so bad it was easier to fix the primitive issues than to try and work around it. Note that this still has one bug: `std::primitive::i32::MAX` does not resolve. However, this fixes the ICE so I'm fine with fixing the link in a later PR. This is part of a series of refactors to make #76467 possible. This is best reviewed commit-by-commit; it has detailed commit messages. r? `@euclio`
-
-
-
Auto merge of #77154 - fusion-engineering-forks:lazy-stdio, r=dtolnay
Remove std::io::lazy::Lazy in favour of SyncOnceCell The (internal) std::io::lazy::Lazy was used to lazily initialize the stdout and stdin buffers (and mutexes). It uses atexit() to register a destructor to flush the streams on exit, and mark the streams as 'closed'. Using the stream afterwards would result in a panic. Stdout uses a LineWriter which contains a BufWriter that will flush the buffer on drop. This one is important to be executed during shutdown, to make sure no buffered output is lost. It also forbids access to stdout afterwards, since the buffer is already flushed and gone. Stdin uses a BufReader, which does not implement Drop. It simply forgets any previously read data that was not read from the buffer yet. This means that in the case of stdin, the atexit() function's only effect is making stdin inaccessible to the program, such that later accesses result in a panic. This is uncessary, as it'd have been safe to access stdin during shutdown of the program. --- This change removes the entire io::lazy module in favour of SyncOnceCell. SyncOnceCell's fast path is much faster (a single atomic operation) than locking a sys_common::Mutex on every access like Lazy did. However, SyncOnceCell does not use atexit() to drop the contained object during shutdown. As noted above, this is not a problem for stdin. It simply means stdin is now usable during shutdown. The atexit() call for stdout is moved to the stdio module. Unlike the now-removed Lazy struct, SyncOnceCell does not have a 'gone and unusable' state that panics. Instead of adding this again, this simply replaces the buffer with one with zero capacity. This effectively flushes the old buffer *and* makes any writes afterwards pass through directly without touching a buffer, making print!() available during shutdown without panicking. --- In addition, because the contents of the SyncOnceCell are no longer dropped, we can now use `&'static` instead of `Arc` in `Stdout` and `Stdin`. This also saves two levels of indirection in `stdin()` and `stdout()`, since Lazy effectively stored a `Box<Arc<T>>`, and SyncOnceCell stores the `T` directly.
-
Fix typo in ExpnData documentation
This mis-highlighted the entire documentation as code.
-
This patch also: * Add soft-float supports: only f32 * zero-extend i8/i16 to i32 because MIPS only supports register-length arithmetic. * Update table in asm! chapter in unstable book.
-
Auto merge of #76986 - jonas-schievink:ret-in-reg, r=nagisa
Return values up to 128 bits in registers This fixes #26494 (comment) by making Rust's default ABI pass return values up to 128 bits in size in registers, just like the System V ABI. The result is that these methods from the comment linked above now generate the same code, making the Rust ABI as efficient as the `"C"` ABI: ```rust pub struct Stats { x: u32, y: u32, z: u32, } pub extern "C" fn sum_c(a: &Stats, b: &Stats) -> Stats { return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }; } pub fn sum_rust(a: &Stats, b: &Stats) -> Stats { return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }; } ``` ```asm sum_rust: movl (%rsi), %eax addl (%rdi), %eax movl 4(%rsi), %ecx addl 4(%rdi), %ecx movl 8(%rsi), %edx addl 8(%rdi), %edx shlq $32, %rcx orq %rcx, %rax retq ```
-
-
-
Auto merge of #77247 - jonas-schievink:rollup-r6ehh8h, r=jonas-schievink
Rollup of 10 pull requests Successful merges: - #76917 (Add missing code examples on HashMap types) - #77107 (Enable const propagation into operands at mir_opt_level=2) - #77129 (Update cargo) - #77167 (Fix FIXME in core::num test: Check sign of zero in min/max tests.) - #77184 (Rust vec bench import specific rand::RngCore) - #77208 (Late link args order) - #77209 (Fix documentation highlighting in ty::BorrowKind) - #77231 (Move helper function for `missing_const_for_fn` out of rustc to clippy) - #77235 (pretty-print-reparse hack: Rename some variables for clarity) - #77243 (Test more attributes in test issue-75930-derive-cfg.rs) Failed merges: r? `@ghost`
-
liveness: Access live nodes directly through self.lnks[ln]
Tomasz Miąsko committedSep 27, 2020 Loading status checks…
Commits on Sep 26, 2020
-
Rollup merge of #77243 - Aaron1011:more-derive-test, r=petrochenkov
Test more attributes in test issue-75930-derive-cfg.rs Split out from #76130 This tests our handling of combining derives, derive helper attributes, attribute macros, and `cfg`/`cfg_attr`
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits

