Skip to content

Rollup of 7 pull requests #133375

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 19 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

thomcc and others added 19 commits October 10, 2024 18:36
AddressSanitizer adds instrumentation to global variables unless the
[`no_sanitize_address`](https://llvm.org/docs/LangRef.html#global-attributes)
attribute is set on them.

This commit extends the existing `#[no_sanitize(address)]` attribute to
set this; previously it only had the desired effect on functions.
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.
…r=rcvalle

Allow disabling ASan instrumentation for globals

AddressSanitizer adds instrumentation to global variables unless the [`no_sanitize_address`](https://llvm.org/docs/LangRef.html#global-attributes) attribute is set on them.

This commit extends the existing `#[no_sanitize(address)]` attribute to set this; previously it only had the desired effect on functions.

(cc rust-lang#39699)
…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
… r=fmease

Add specific diagnostic for using macro_rules macro as attribute/derive

Fixes rust-lang#132928
…lay-impl, r=workingjubilee

Reduce integer `Display` implementation size

I was thinking about rust-lang#128204 and how we could reduce the size of the code and just realized that we didn't need the `_fmt` method to be implemented on signed integers, which in turns allow to simplify greatly the macro call.

r? `@workingjubilee`
…-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.
…e, r=jhpratt

Mark `<[T; N]>::as_mut_slice` with the `const` specifier.

Tracking issue: rust-lang#133333

`<[T; N]>::as_mut_slice` can have the `const` specifier without any changes to the function body.
…dtolnay

Remove unnecessary bool from `ExpectedFound::new`

It's true almost everywhere, and the one place it's not can be replaced w/ an if statement.
@rustbot rustbot added O-unix Operating system: Unix-like PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Nov 23, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Collaborator

bors commented Nov 23, 2024

📌 Commit 54a28f6 has been approved by matthiaskrgr

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 23, 2024
@bors
Copy link
Collaborator

bors commented Nov 23, 2024

⌛ Testing commit 54a28f6 with merge d819de9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 23, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127483 (Allow disabling ASan instrumentation for globals)
 - rust-lang#131505 (use `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)` as a `TMPDIR` fallback on Darwin)
 - rust-lang#132949 (Add specific diagnostic for using macro_rules macro as attribute/derive)
 - rust-lang#133247 (Reduce integer `Display` implementation size)
 - rust-lang#133286 (Re-delay a resolve `bug` related to `Self`-ctor in patterns)
 - rust-lang#133332 (Mark `<[T; N]>::as_mut_slice` with the `const` specifier.)
 - rust-lang#133366 (Remove unnecessary bool from `ExpectedFound::new`)

Failed merges:

 - rust-lang#131859 (Update TRPL to add new Chapter 17: Async and Await)

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

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

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

---- collections::btree::set::tests::test_show stdout ----
thread 'collections::btree::set::tests::test_show' panicked at alloc/src/collections/btree/set/tests.rs:489:5:
assertion `left == right` failed
  left: "{18446744073709551614, 18446744073709551613}"
 right: "{1, 2}"
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   3: core::panicking::assert_failed
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- collections::linked_list::tests::test_show stdout ----
thread 'collections::linked_list::tests::test_show' panicked at alloc/src/collections/linked_list/tests.rs:539:5:
assertion `left == right` failed
  left: "[18446744073709551615, 18446744073709551614, 18446744073709551613, 18446744073709551612, 18446744073709551611, 18446744073709551610, 18446744073709551609, 18446744073709551608, 18446744073709551607, 18446744073709551606]"
 right: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   3: core::panicking::assert_failed
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- rc::tests::test_from_box_trait stdout ----
thread 'rc::tests::test_from_box_trait' panicked at alloc/src/rc/tests.rs:476:5:
  left: "18446744073709551492"
 right: "123"
stack backtrace:
   0: rust_begin_unwind
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- rc::tests::test_into_from_raw_unsized stdout ----
thread 'rc::tests::test_into_from_raw_unsized' panicked at alloc/src/rc/tests.rs:199:5:
  left: "18446744073709551492"
 right: "123"
stack backtrace:
   0: rust_begin_unwind
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- rc::tests::test_into_from_weak_raw_unsized stdout ----
thread 'rc::tests::test_into_from_weak_raw_unsized' panicked at alloc/src/rc/tests.rs:241:5:
  left: "18446744073709551492"
 right: "123"
stack backtrace:
   0: rust_begin_unwind
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- rc::tests::test_show stdout ----
thread 'rc::tests::test_show' panicked at alloc/src/rc/tests.rs:340:5:
  left: "18446744073709551540"
 right: "75"
stack backtrace:
   0: rust_begin_unwind
---

---- sync::tests::test_unsized stdout ----
thread 'sync::tests::test_unsized' panicked at alloc/src/sync/tests.rs:406:5:
assertion `left == right` failed
  left: "[18446744073709551614, 18446744073709551613, 18446744073709551612]"
 right: "[1, 2, 3]"
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
---
    sync::tests::test_unsized

test result: FAILED. 391 passed; 11 failed; 1 ignored; 0 measured; 0 filtered out; finished in 149.48ms

error: test failed, to rerun pass `-p alloc --lib`
  local time: Sat Nov 23 12:13:40 UTC 2024
  network time: Sat, 23 Nov 2024 12:13:40 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Collaborator

bors commented Nov 23, 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 23, 2024
@jieyouxu
Copy link
Member

@bors r-

@jieyouxu jieyouxu closed this Nov 23, 2024
@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-j9uf0mx branch January 25, 2025 09:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
O-unix Operating system: Unix-like PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.