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 14 pull requests #89512

Merged
merged 34 commits into from
Oct 4, 2021
Merged

Rollup of 14 pull requests #89512

merged 34 commits into from
Oct 4, 2021

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

CDirkx and others added 30 commits June 18, 2021 15:56
These structs have misleading names.  An ExitStatus[Error] is actually
a Unix wait status; an ExitCode is actually an exit status.

The Display impls are fixed, but the Debug impls are still misleading,
as reported in rust-lang#74832.

Fix this by pretending that these internal structs are called
`unix_exit_status` and `unix_wait_status` as applicable.  (We can't
actually rename the structs because of the way that the cross-platform
machinery works: the names are cross-platform.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This also makes `<[T; N]>::as_slice` const due to its trivial nature.
namely `Vec::extend_from_within`
fix: move test that require mut to another

Adding TODOs for Option::take and Option::copied

TODO to FIXME + moving const stability under normal

Moving const stability attr under normal stab attr

move more rustc stability attributes
For some reason unboxed_closures supresses the feature gate for
min_specialization when implementing TrustedStep. min_specialization is
the true feature that is used.
On MinGW toolchains the various features (such as function sections)
necessary to eliminate dead function references are disabled due to
various bugs. This means that the windows sockets library will most
likely remain linked to any mingw toolchain built program that also
utilizes libstd.

That said, I made an attempt to also enable `function-sections` and
`--gc-sections` during my experiments, but the symbol references
remained, sadly.
This is cleaner and removes an unstable feature usage
…plett

Add `Ipv6Addr::is_benchmarking`

This PR adds the unstable method `Ipv6Addr::is_benchmarking`. This method is added for parity with `Ipv4Addr::is_benchmarking`, and I intend to use it in a future rework of `Ipv6Addr::is_global` (edit: rust-lang#86634) to more accurately follow the [IANA Special Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml) (like is done in `Ipv4Addr::is_global`).

With `Ipv6Addr::is_benchmarking` and `Ipv4Addr::is_benchmarking` now both existing, `IpAddr::is_benchmarking` is also added.
…-replace, r=joshtriplett

const fn for option copied, take & replace

Tracking issue: [rust-lang#67441](rust-lang#67441)

Adding const fn for the copied, take and replace method of Option. Also adding necessary unit test.

It's my first contribution so I am pretty sure I don't know what I'm doing but there's a first for everything!
…metics_as_const, r=joshtriplett

Mark unsafe methods NonZero*::unchecked_(add|mul) as const.

Now that rust-lang/rfcs#3016 has landed, these two unstable `std` function can be marked `const`, according to this detail of rust-lang#84186.
…block-std, r=dtolnay

Remove unnecessary unsafe block in `process_unix`

Because it's nested under this unsafe fn!

This block isn't detected as unnecessary because of a bug in the compiler: rust-lang#88260.
Manual Debug for Unix ExitCode ExitStatus ExitStatusError

These structs have misleading names.  An ExitStatus[Error] is actually a Unix wait status; an ExitCode is actually an exit status.  These misleading names appear in the `Debug` output.

The `Display` impls on Unix have been improved, but the `Debug` impls are still misleading, as reported in rust-lang#74832.

Fix this by pretending that these internal structs are called `unix_exit_status` and `unix_wait_status` as applicable.  (We can't actually rename the structs because of the way that the cross-platform machinery works: the names are cross-platform.)

After this change, this program
```
#![feature(exit_status_error)]
fn main(){
    let x = std::process::Command::new("false").status().unwrap();
    dbg!(x.exit_ok());
    eprintln!("x={:?}",x);
}
```
produces this output
```
[src/main.rs:4] x.exit_ok() = Err(
    ExitStatusError(
        unix_wait_status(
            256,
        ),
    ),
)
x=ExitStatus(unix_wait_status(256))
```

Closes rust-lang#74832
…oshtriplett

Partially stabilize `array_methods`

This stabilizes `<[T; N]>::as_slice` and `<[T; N]>::as_mut_slice`, which is forms part of the `array_methods` feature: rust-lang#76118.

This also makes `<[T; N]>::as_slice` const due to its trivial nature.
Add missing `# Panics` section to `Vec` method

namely `Vec::extend_from_within`
…llot

Remove some feature gates

The first commit removes various feature gates that are unused. The second commit replaces some `Fn` implementations with `Iterator` implementations, which is much cleaner IMO. The third commit replaces an unboxed_closures feature gate with min_specialization. For some reason the unboxed_closures feature gate suppresses the min_specialization feature gate from triggering on an `TrustedStep` impl. The last comment just turns a regular comment into a doc comment as drive by cleanup. I can move it to a separate PR if preferred.
Add truncate note to Vec::resize

A very minor addition to the `Vec::resize` documentation to point out the `truncate` method.
When I was searching for something matching `truncate` I managed to miss it, along with some colleagues. We later found it by chance. We did find `resize` however, so I was hoping to point it out in the documentation.
Fix typos in rustdoc/lints

This PR merely fixes a few typos in a recently introduced change :)

Refs: rust-lang#85223
Only register `WSACleanup` if `WSAStartup` is actually ever called

See rust-lang#85595

Fixes rust-lang#85441
…mulacrum

Add regression test for spurious const error with NLL

Fixes rust-lang#55825
@rustbot rustbot added the rollup A PR which is a rollup label Oct 4, 2021
@Manishearth
Copy link
Member Author

@bors r+ p=5

@bors
Copy link
Contributor

bors commented Oct 4, 2021

📌 Commit 5c5dde8 has been approved by Manishearth

@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 Oct 4, 2021
@bors
Copy link
Contributor

bors commented Oct 4, 2021

⌛ Testing commit 5c5dde8 with merge 44593ae...

@bors
Copy link
Contributor

bors commented Oct 4, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 44593ae to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 4, 2021
@bors bors merged commit 44593ae into rust-lang:master Oct 4, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 4, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (44593ae): comparison url.

Summary: This change led to large relevant improvements 🎉 in compiler performance.

  • Large improvement in instruction counts (up to -1.4% on incr-patched: static str 6144 builds of issue-46449)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.