about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-10-17Make Result::as_mut constwoppopo-1/+26
2021-10-17Auto merge of #89968 - JohnTitor:rollup-z51n967, r=JohnTitorbors-43/+23
Rollup of 7 pull requests Successful merges: - #89507 (Add `#[repr(i8)]` to `Ordering`) - #89849 (CI: Selecting the Xcode version no longer needed with the macos-11 runners.) - #89886 (Update the wasi-libc built with the wasm32-wasi target) - #89907 (Remove FIXME since there is nothing to be fixed) - #89943 (clippy::complexity fixes) - #89953 (Make Option::as_mut const) - #89958 (Correct small typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-17Rollup merge of #89958 - nhamovitz:patch-1, r=nagisaYuki Okushi-1/+1
Correct small typo
2021-10-17Rollup merge of #89953 - woppopo:option_const_as_mut, r=oli-obkYuki Okushi-1/+11
Make Option::as_mut const Adding `const` for `Option::as_mut`. Tracking issue: #67441
2021-10-17Rollup merge of #89943 - matthiaskrgr:clpcompl, r=oli-obkYuki Okushi-11/+9
clippy::complexity fixes
2021-10-17Rollup merge of #89907 - GuillaumeGomez:correctly-emit-errors, r=camelidYuki Okushi-1/+0
Remove FIXME since there is nothing to be fixed Resolves #88593. The errors are deduplicated when displayed to users. They only appear multiple times in UI tests. cc ``@jyn514`` r? ``@camelid``
2021-10-17Rollup merge of #89886 - alexcrichton:update-wasi-libc, r=kennytmYuki Okushi-1/+1
Update the wasi-libc built with the wasm32-wasi target This commit updates the wasi-libc that we include with the wasm32-wasi target, which brings in various misc fixes such as musl updates and some math tweaks.
2021-10-17Rollup merge of #89849 - rusticstuff:remove-xcode-select, r=Mark-SimulacrumYuki Okushi-28/+0
CI: Selecting the Xcode version no longer needed with the macos-11 runners. It does nothing nowadays since `/Applications/Xcode_12.2.app` does not exist in the GH runner environment and automatically using the latest version selected by the GH environment is better anyway.
2021-10-17Rollup merge of #89507 - lopopolo:lopopolo/ordering-repr-i8, r=joshtriplettYuki Okushi-0/+1
Add `#[repr(i8)]` to `Ordering` Followup to #89491 to allow `Ordering` to auto-derive `AsRepr` once the proposal to add `AsRepr` (#81642) lands. cc ``@joshtriplett``
2021-10-16Correct typonhamovitz-1/+1
2021-10-16Remove FIXME since there is nothing to be fixed.Guillaume Gomez-1/+0
The errors are deduplicated when displayed to users. They only appear multiple times in UI tests.
2021-10-16Auto merge of #89860 - camsteffen:macro-semi, r=petrochenkovbors-729/+775
Remove trailing semicolon from macro call span Macro call site spans are now less surprising/more consistent since they no longer contain a semicolon after the macro call. The downside is that we need to do a little guesswork to get the semicolon in diagnostics. But this should not be noticeable since it is rare for the semicolon to not immediately follow the macro call.
2021-10-16clippy::complexity changesMatthias Krüger-11/+9
2021-10-17Add `#![cfg_attr(bootstrap, feature(const_panic))]` to ↵woppopo-0/+1
`library/core/tests/lib.rs`
2021-10-17Make Option::as_mut constwoppopo-1/+10
2021-10-16Auto merge of #89939 - matthiaskrgr:rollup-q3lrdck, r=matthiaskrgrbors-184/+235
Rollup of 10 pull requests Successful merges: - #89509 (Stabilize `unreachable_unchecked` as `const fn`) - #89898 (Remove alloc::prelude) - #89902 (Restrict the aarch64 outline atomics test to Linux) - #89906 (Moved format-version constant to rustdoc-json-types) - #89912 (emitter: current substitution can be multi-line) - #89914 (Emit impl difference error for GenericBoundFailure too) - #89915 (Some outlives cleanup) - #89918 (Add some GATs related regression tests) - #89921 ([fuchsia] Update process info struct) - #89925 (updating docs to mention usage of AtomicBool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-16Rollup merge of #89925 - gilescope:update-docs-atomic-usage, r=m-ou-seMatthias Krüger-1/+1
updating docs to mention usage of AtomicBool Mouse mentioned we should point out that atomic bool is used by the std lib these days. ( https://github.com/m-ou-se/getrandom/pull/1 )
2021-10-16Rollup merge of #89921 - joshuaseaton:zircon-process, r=tmandryMatthias Krüger-4/+7
[fuchsia] Update process info struct The fuchsia platform is in the process of softly transitioning over to using a new value for ZX_INFO_PROCESS with a new corresponding struct. This change migrates libstd. See [fxrev.dev/510478](https://fxrev.dev/510478) and [fxbug.dev/30751](https://fxbug.dev/30751) for more detail.
2021-10-16Rollup merge of #89918 - JohnTitor:gats-tests, r=jackh726Matthias Krüger-0/+55
Add some GATs related regression tests Closes #88287, closes #88405
2021-10-16Rollup merge of #89915 - jackh726:outlives_cleanup, r=nikomatsakisMatthias Krüger-115/+100
Some outlives cleanup No semantic changes here, only moving code around + using `LocalDefId` instead of `HirId` r? ````@nikomatsakis````
2021-10-16Rollup merge of #89914 - jackh726:gat_genericboundfailure, r=estebankMatthias Krüger-17/+22
Emit impl difference error for GenericBoundFailure too Fixes #86787 r? ````@estebank````
2021-10-16Rollup merge of #89912 - davidtwco:issue-89280-split-lines-multiple-lines, ↵Matthias Krüger-1/+34
r=oli-obk emitter: current substitution can be multi-line Fixes #89280. In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. r? ````@oli-obk````
2021-10-16Rollup merge of #89906 - ↵Matthias Krüger-1/+4
yuvaldolev:move-format-version-to-rustdoc-json-types, r=CraftSpider Moved format-version constant to rustdoc-json-types Addresses #88620 Moved format-version constant from rustdoc to rustdoc-json-types.
2021-10-16Rollup merge of #89902 - rusticstuff:outline-atomics-linux-only, ↵Matthias Krüger-0/+1
r=workingjubilee Restrict the aarch64 outline atomics test to Linux The test was introduced in #83655, which enables the `outline-atomics` feature for aarch64-unknown-linux-* but not for any other aarch64 targets. The test did not check for Linux causing test failures on aarch64-apple-darwin. r? `@workingjubilee`
2021-10-16Rollup merge of #89898 - Amanieu:remove_alloc_prelude, r=joshtriplettMatthias Krüger-34/+4
Remove alloc::prelude As per the libs team decision in #58935. Closes #58935
2021-10-16Rollup merge of #89509 - jhpratt:stabilize-const_unreachable_unchecked, ↵Matthias Krüger-11/+7
r=oli-obk Stabilize `unreachable_unchecked` as `const fn` Closes #53188 This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With #89508, that is no longer an issue. ````@rustbot```` label +A-const-eval +A-const-fn +T-lang +S-blocked (not sure why it's T-lang, but that's what the tracking issue is)
2021-10-15Auto merge of #85379 - mdaverde:uds-abstract, r=joshtriplettbors-4/+416
Add abstract namespace support for Unix domain sockets Hello! The other day I wanted to mess around with UDS in Rust and found that abstract namespaces ([unix(7)](https://man7.org/linux/man-pages/man7/unix.7.html)) on Linux still needed development. I took the approach of adding `_addr` specific public functions to reduce conflicts. Feature name: `unix_socket_abstract` Tracking issue: #85410 Further context: #42048 ## Non-platform specific additions `UnixListener::bind_addr(&SocketAddr) -> Result<UnixListener>` `UnixStream::connect_addr(&SocketAddr) -> Result<()>` `UnixDatagram::bind_addr(&SocketAddr) -> Result<UnixDatagram>` `UnixDatagram::connect_addr(&SocketAddr) -> Result<()>` `UnixDatagram::send_to_addr(&self, &[u8], &SocketAddr) -> Result<usize>` ## Platform-specific (Linux) additions `SocketAddr::from_abstract_namespace(&[u8]) -> SocketAddr` `SockerAddr::as_abstract_namespace() -> Option<&[u8]>` ## Example ```rust #![feature(unix_socket_abstract)] use std::os::unix::net::{UnixListener, SocketAddr}; fn main() -> std::io::Result<()> { let addr = SocketAddr::from_abstract_namespace(b"namespace")?; // Linux only let listener = match UnixListener::bind_addr(&addr) { Ok(sock) => sock, Err(err) => { println!("Couldn't bind: {:?}", err); return Err(err); } }; Ok(()) } ``` ## Further Details The main inspiration for the implementation came from the [nix-rust](https://github.com/nix-rust/nix/blob/master/src/sys/socket/addr.rs#L558) crate but there are also other [historical](https://github.com/rust-lang/rust/commit/c4db0685b181f12c4285dac3d932f1859bba74f5) [attempts](https://github.com/tormol/uds/blob/master/src/addr.rs#L324) with similar approaches. A comment I did have was with this change, we now allow a `SocketAddr` to be constructed explicitly rather than just used almost as a handle for the return of `peer_addr` and `local_addr`. We could consider adding other explicit constructors (e.g. `SocketAddr::from_pathname`, `SockerAddr::from_unnamed`). Cheers!
2021-10-15updating docs to reflect current situationGiles Cope-1/+1
2021-10-15Auto merge of #84096 - m-ou-se:windows-bcrypt-random, r=dtolnaybors-29/+16
Use BCryptGenRandom instead of RtlGenRandom on Windows. This removes usage of RtlGenRandom on Windows, in favour of BCryptGenRandom. BCryptGenRandom isn't available on XP, but we dropped XP support a while ago.
2021-10-15[fuchsia] Update process info structJoshua Seaton-4/+7
The fuchsia platform is in the process of softly transitioning over to using a new value for ZX_INFO_PROCESS with a new corresponding struct. This change migrates libstd. See fxrev.dev/510478 and fxbug.dev/30751 for more detail.
2021-10-16Add some GATs related regression testsYuki Okushi-0/+55
2021-10-15Move some outlives bounds things from rustc_trait_selection to rustc_typeckjackh726-59/+55
2021-10-15Use LocalDefId directly in more places in wfcheckjackh726-35/+22
2021-10-15Move push_outlives_components to rustc_inferjackh726-21/+23
2021-10-15Auto merge of #89337 - mbrubeck:vec-leak, r=m-ou-sebors-3/+5
Avoid allocations and copying in Vec::leak The [`Vec::leak`] method (#62195) is currently implemented by calling `Vec::into_boxed_slice` and `Box::leak`. This shrinks the vector before leaking it, which potentially causes a reallocation and copies the vector's contents. By avoiding the conversion to `Box`, we can instead leak the vector without any expensive operations, just by returning a slice reference and forgetting the `Vec`. Users who *want* to shrink the vector first can still do so by calling `shrink_to_fit` explicitly. **Note:** This could break code that uses `Box::from_raw` to “un-leak” the slice returned by `Vec::leak`. However, the `Vec::leak` docs explicitly forbid this, so such code is already incorrect. [`Vec::leak`]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.leak
2021-10-15Emit impl difference error for GenericBoundFailure toojackh726-17/+22
2021-10-15emitter: current substitution can be multi-lineDavid Wood-1/+34
In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-15Auto merge of #88717 - tabokie:vecdeque-fast-append, r=m-ou-sebors-2/+30
Optimize VecDeque::append Optimize `VecDeque::append` to do unsafe copy rather than iterating through each element. On my `Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz`, the benchmark shows 37% improvements: ``` Master: custom-bench vec_deque_append 583164 ns/iter custom-bench vec_deque_append 550040 ns/iter Patched: custom-bench vec_deque_append 349204 ns/iter custom-bench vec_deque_append 368164 ns/iter ``` Additional notes on the context: this is the third attempt to implement a non-trivial version of `VecDeque::append`, the last two are reverted due to unsoundness or regression, see: - https://github.com/rust-lang/rust/pull/52553, reverted in https://github.com/rust-lang/rust/pull/53571 - https://github.com/rust-lang/rust/pull/53564, reverted in https://github.com/rust-lang/rust/pull/54851 Both cases are covered by existing tests. Signed-off-by: tabokie <xy.tao@outlook.com>
2021-10-15Add missing bcrypt.lib to make-fulldeps Makefile.Mara Bos-2/+2
2021-10-15Use BCryptGenRandom instead of RtlGenRandom on Windows.Mara Bos-27/+14
BCryptGenRandom isn't available on XP, but we dropped XP support a while ago.
2021-10-15Auto merge of #88540 - ibraheemdev:swap-unchecked, r=kennytmbors-13/+85
add `slice::swap_unchecked` An unsafe version of `slice::swap` that does not do bounds checking.
2021-10-15Moved format-version constant to rustdoc-json-typesYuval Dolev-1/+4
2021-10-15Fix clippy with changed macro statement spansCameron Steffen-130/+126
2021-10-15Bless testsCameron Steffen-554/+575
2021-10-15Guess semicolon span for macro statementsCameron Steffen-2/+45
2021-10-15Remove trailing semicolon from macro call spanCameron Steffen-27/+19
2021-10-15Remove redundant matchingCameron Steffen-16/+10
2021-10-15Auto merge of #89903 - matthiaskrgr:rollup-s0c69xl, r=matthiaskrgrbors-114/+236
Rollup of 7 pull requests Successful merges: - #86011 (move implicit `Sized` predicate to end of list) - #89821 (Add a strange test for `unsafe_code` lint.) - #89859 (add dedicated error variant for writing the discriminant of an uninhabited enum variant) - #89870 (Suggest Box::pin when Pin::new is used instead) - #89880 (Use non-checking TLS relocation in aarch64 asm! sym test.) - #89885 (add long explanation for E0183) - #89894 (Remove unused dependencies from rustc_const_eval) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-15Rollup merge of #89894 - camsteffen:unused-deps, r=Mark-SimulacrumMatthias Krüger-4/+0
Remove unused dependencies from rustc_const_eval
2021-10-15Rollup merge of #89885 - cameron1024:long-explanation-E0183, r=GuillaumeGomezMatthias Krüger-4/+44
add long explanation for E0183 Addresses #61137