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 9 pull requests #133322

Closed

Conversation

compiler-errors
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

thomcc and others added 23 commits October 10, 2024 18:36
The old name and comment suggest that this parser is only used for options
beginning with `no-`, which is mostly true but not entirely true.
Passing an explicit boolean value (`on`, `off` etc.) appears to work, but
actually puts the compiler into an unintended state where unstable _options_
are still forbidden, but unstable values of _some_ stable options are allowed.
The `src/tools/rustc-perf` submodule is needed for vendoring because
it is included in the vendor set.
For the code pattern reported in
<rust-lang#133272>,

```rs
impl Foo {
   fn fun() {
        let S { ref Self } = todo!();
   }
}
```

<rust-lang#121208> converted this to a
`span_bug` from a `span_delayed_bug` because this specific self-ctor
code pattern lacked test coverage. It turns out this can be hit but we
just lacked test coverage, so change it back to a `span_delayed_bug` and
add a target tested case.
This moves the list of submodules needed to vendor close to the list of
cargo workspaces with the intent to help ensure they keep up-to-date and
in sync.
Is available since libc 0.2.162
…ocal, r=dtolnay

Stabilize `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local`

Make `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local` stable (+const).

Newly stable API:

```rust
impl Ipv6Addr {
	// Newly stable under `ipv6_is_unique_local`
	const fn is_unique_local(&self) -> bool;

	// Newly stable under `ipv6_is_unique_local`
	const fn is_unicast_link_local(&self) -> bool;
}
```

These stabilise a subset of the following tracking issue:
- rust-lang#27709

I have looked and could not find any issues with `is_unique_local` and `is_unicast_link_local`. There is a well received comment calling for stabilisation of the latter function.

Both functions are well defined and consistent with implementations in other languages:
- [Go](https://cs.opensource.google/go/go/+/refs/tags/go1.23.0:src/net/netip/netip.go;l=518)
- [Python](https://github.com/python/cpython/blob/e9d1bf353c3ccafc0d9b61b1b3688051bc976604/Lib/ipaddress.py#L2319-L2321)
- [Ruby (unique local)](https://ruby-doc.org/stdlib-2.5.1/libdoc/ipaddr/rdoc/IPAddr.html#private-3F-source)
- [Ruby (unicast link local)](https://ruby-doc.org/stdlib-2.5.1/libdoc/ipaddr/rdoc/IPAddr.html#link_local-3F-source)

cc implementor `@little-dude`
(I can't find the original PR for `is_unqiue_local`)

r? libs-api
`@rustbot` label +T-libs-api +needs-fcp
distinguish overflow and unimplemented in Step::steps_between
…olnay

use `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)` as a `TMPDIR` fallback on Darwin

Rebased version of rust-lang#100824, FCP has completed there. Motivation from rust-lang#100824 (comment):

> This is a behavioral change in an edge case on Darwin platforms (macOS, iOS, ...).
>
> Specifically, this changes it so that iff `TMPDIR` is unset in the environment, then we use `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)` to query the user temporary directory (previously we just returned `"/tmp"`). If this fails (probably possible in a sandboxed program), only then do we fallback to `"/tmp"` (as before).
>
> The motivations here are two-fold:
>
> 1. This is better for security, and is in line with the [platform security recommendations](https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585-SW10), as it is unavailable to other users (although it is the same value as seen by all other processes run by the same user).
> 2. This is a more consistent fallback for when `getenv("TMPDIR")` is unavailable, as `$TMPDIR` is usually initialized to the `DARWIN_USER_TEMP_DIR`.
>
> It seems quite unlikely that anybody will break because of this, and I think it falls under the carve-out we have for platform specific behavior: https://doc.rust-lang.org/nightly/std/io/index.html#platform-specific-behavior.

Closes rust-lang#99608.
Closes rust-lang#100824.

`@rustbot` label O-apple T-libs-api

r? Dylan-DPC
Stop being so bail-y in candidate assembly

A conceptual follow-up to rust-lang#132084. We gotta stop bailing so much when there are errors; it's both unnecessary, leads to weird knock-on errors, and it's messing up the vibes lol
…, r=jieyouxu

Don't allow `-Zunstable-options` to take a value

Passing an explicit boolean value (`-Zunstable-options=on`, `off` etc.) sometimes appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed.

This is a result of `-Zunstable-options` being checked in multiple different places, in slightly different ways. Fixing the checks in `config::nightly_options` to understand boolean values would be non-trivial, so for now it's easier to make things consistent by forbidding values in the `-Z` parser.

---

There were a few uses of this in tests, which happened to work because they were tests of unstable values.
Fix missing submodule in `./x vendor`

The `src/tools/rustc-perf` submodule is needed for vendoring because it is included in the vendor set.

To test this:

1. Get a fresh clone of `rust-lang/rust`
2. `./x vendor`
…-errors

Re-delay a resolve `bug` related to `Self`-ctor in patterns

For the code pattern reported in <rust-lang#133272>,

```rs
impl Foo {
   fn fun() {
        let S { ref Self } = todo!();
   }
}
```

<rust-lang#121208> converted this to a `span_bug` from a `span_delayed_bug` because this specific self-ctor code pattern lacked test coverage. It turns out this can be hit but we just lacked test coverage, so change it back to a `span_delayed_bug` and add a targeted test case.

Follow-up to rust-lang#121208, cc `@nnethercote` (very good exercise to expose our test coverage gaps).
Fixes rust-lang#133272.
…g-neg, r=workingjubilee

Add code example for `wrapping_neg` method for signed integers

With this example, we make it obvious that `wrapping_neg` works both ways (neg to pos and pos to neg).

r? `@workingjubilee`
Use arc4random of libc for RTEMS target

Switch to the `arc4random` from libc. It is available since libc 0.2.162
@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 22, 2024
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Nov 22, 2024

📌 Commit db9f07a has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2024
@bors
Copy link
Contributor

bors commented Nov 22, 2024

⌛ Testing commit db9f07a with merge 929f8998990f0ae8cf547eab279d75e4ab3d1e43...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 22, 2024
…mpiler-errors

Rollup of 9 pull requests

Successful merges:

 - rust-lang#129238 (Stabilize `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local`)
 - rust-lang#130867 (distinguish overflow and unimplemented in Step::steps_between)
 - rust-lang#131505 (use `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)` as a `TMPDIR` fallback on Darwin)
 - rust-lang#132090 (Stop being so bail-y in candidate assembly)
 - rust-lang#133159 (Don't allow `-Zunstable-options` to take a value )
 - rust-lang#133215 (Fix missing submodule in `./x vendor`)
 - rust-lang#133286 (Re-delay a resolve `bug` related to `Self`-ctor in patterns)
 - rust-lang#133301 (Add code example for `wrapping_neg` method for signed integers)
 - rust-lang#133313 (Use arc4random of libc for RTEMS target)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Nov 22, 2024

💔 Test failed - checks-actions

@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 22, 2024
@compiler-errors
Copy link
Member Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2024
@compiler-errors
Copy link
Member Author

2024-11-22T04:40:36.9729829Z �[1m�[31merror�[0m�[1m:�[0m failed to remove file C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\release\cargo.exe
2024-11-22T04:40:36.9730894Z
2024-11-22T04:40:36.9731006Z Caused by:
2024-11-22T04:40:36.9731307Z Access is denied. (os error 5)

@compiler-errors compiler-errors added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Nov 22, 2024
@bors
Copy link
Contributor

bors commented Nov 22, 2024

⌛ Testing commit db9f07a with merge 7a4cf71c98cc827806c8e02a039f922c07b06413...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 22, 2024
…mpiler-errors

Rollup of 9 pull requests

Successful merges:

 - rust-lang#129238 (Stabilize `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local`)
 - rust-lang#130867 (distinguish overflow and unimplemented in Step::steps_between)
 - rust-lang#131505 (use `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)` as a `TMPDIR` fallback on Darwin)
 - rust-lang#132090 (Stop being so bail-y in candidate assembly)
 - rust-lang#133159 (Don't allow `-Zunstable-options` to take a value )
 - rust-lang#133215 (Fix missing submodule in `./x vendor`)
 - rust-lang#133286 (Re-delay a resolve `bug` related to `Self`-ctor in patterns)
 - rust-lang#133301 (Add code example for `wrapping_neg` method for signed integers)
 - rust-lang#133313 (Use arc4random of libc for RTEMS target)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] object test:false 3.782
warning: function `confstr` is never used
##[warning]   --> /checkout/library/std/src/sys/pal/unix/os.rs:708:4
    |
708 | fn confstr(key: c_int, size_hint: Option<usize>) -> io::Result<OsString> {
    |
    = note: `#[warn(dead_code)]` on by default

warning: function `darwin_temp_dir` is never used

@bors
Copy link
Contributor

bors commented Nov 22, 2024

💔 Test failed - checks-actions

@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 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-spurious-fail-msvc CI spurious failure: target env msvc O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.