Skip to content

Rollup of 6 pull requests #140646

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

Merged
merged 12 commits into from
May 5, 2025
Merged

Rollup of 6 pull requests #140646

merged 12 commits into from
May 5, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented May 4, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fneddy and others added 12 commits April 28, 2025 22:11
The default s390x cpu(z10) does not have vector support. Setting
target-cpu at least to z13 enables vectorisation for s390x architecture
and makes the test pass.
By consecutively initializing `tracing` and `rustc_log`, Rustdoc assumes
that these involve 2 different tracing crates.

I would like to be able to build rustdoc against the same tracing crate
that rustc_log is also built against. Previously this arrangement would
crash rustdoc:

    thread 'main' panicked at rust/compiler/rustc_log/src/lib.rs:142:65:
    called `Result::unwrap()` on an `Err` value: SetGlobalDefaultError("a global default trace dispatcher has already been set")
    stack backtrace:
       0: rust_begin_unwind
       1: core::panicking::panic_fmt
       2: core::result::unwrap_failed
       3: rustc_log::init_logger
       4: rustc_driver_impl::init_logger
       5: rustdoc::main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

    error: the compiler unexpectedly panicked. this is a bug.

    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md

    note: please make sure that you have updated to the latest nightly

    query stack during panic:
    end of query stack
…, r=lcnr

stabilize ptr::swap_nonoverlapping in const

Closes rust-lang#133668

The blocking issue mentioned there is resolved by documentation. We may in the future actually support such code, but that is blocked on rust-lang/const-eval#72 which is non-trivial to implement. Meanwhile, this completes stabilization of all `const fn` in `ptr`. :)

Here's a version of the problematic example to play around with:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=6c390452379fb593e109b8f8ee854d2a

Should be FCP'd with both `@rust-lang/libs-api`  and `@rust-lang/lang`  since  `swap_nonoverlapping` is documented to work as an "untyped" operation but due to the limitation mentioned above, that's not entirely true during const evaluation. I expect this limitation will only be hit in niche corner cases, so the benefits of having this function work most of the time outweigh the downsides of users running into this problem. (Note that unsafe code could already hit this limitation before this PR by doing cursed pointer casts, but having it hidden inside `swap_nonoverlapping` feels a bit different.)
…tor, r=Mark-Simulacrum

Use target-cpu=z13 on s390x codegen const vector test

The default s390x cpu(z10) does not have vector support. Setting target-cpu at least to z13 enables vectorisation for s390x architecture and makes the test pass.
…=Urgau

Small adjustments to `check_attribute_safety` to make the logic more obvious

Follow-up to rust-lang#140617.
…is-retain_mut, r=Mark-Simulacrum

Suggest `retain_mut` over `retain` as `Vec::extract_if` alternative

The docs for `Vec::extract_if` suggest using `Vec::retain` if the user doesn't need the removed item. Given that `extract_if` gives a mutable reference to the evaluated element, `retain_mut` is the most appropriate alternative, not `retain`.
…eGomez

Allow linking rustc and rustdoc against the same single tracing crate

Alternate title: _Ignore "a global default trace dispatcher has already been set" error in Rustdoc_

By consecutively initializing `tracing` and `rustc_log`, Rustdoc assumes that these involve 2 different tracing crates.

I would like to be able to build rustdoc against the same tracing crate that rustc_log is also built against. Previously this arrangement would crash rustdoc:

```console
thread 'main' panicked at rust/compiler/rustc_log/src/lib.rs:142:65:
called `Result::unwrap()` on an `Err` value: SetGlobalDefaultError("a global default trace dispatcher has already been set")
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rustc_log::init_logger
   4: rustc_driver_impl::init_logger
   5: rustdoc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md

note: please make sure that you have updated to the latest nightly

query stack during panic:
end of query stack
```
…ource-info-fix, r=oli-obk

Async drop source info fix for proxy-drop-coroutine

Fixes crash at debug info generation: rust-lang#140426 .
Also, the submitted example requires sync Drop implementation too.
Because sync version is required for unwind and when drop is performed in sync context (sync function).

Probably, it is also needed to add such a lint/error about missed `impl Drop`, when there is `impl AsyncDrop`.

Fix description: even minimal, empty coroutine (for proxy-coroutine) has 3 states and the source info array should have 3 elements too.

```
#![feature(async_drop)]

use std::future::AsyncDrop;
use std::pin::Pin;

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let _st = St;
}

struct St;

impl AsyncDrop for St {
    async fn drop(self: Pin<&mut Self>) {
        println!("123");
    }
}
```
@rustbot rustbot added 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 4, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented May 4, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 4, 2025

📌 Commit 0b8789c has been approved by tgross35

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 May 4, 2025
@bors
Copy link
Collaborator

bors commented May 4, 2025

⌛ Testing commit 0b8789c with merge 2958d89...

@bors
Copy link
Collaborator

bors commented May 5, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 2958d89 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 5, 2025
@bors bors merged commit 2958d89 into rust-lang:master May 5, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone May 5, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#137280 stabilize ptr::swap_nonoverlapping in const 7175ce1bc5c90af9d9d9e716957faf4e4a623450 (link)
#140457 Use target-cpu=z13 on s390x codegen const vector test 1a45f8f25b4f6f0e6aa24026303a959e4d0edbb8 (link)
#140619 Small adjustments to check_attribute_safety to make the l… ca33058292d8f6b1b67d0ad346c531b9daee755b (link)
#140625 Suggest retain_mut over retain as Vec::extract_if alt… 00af53459336db53321a7c42643cb9d3dd43d698 (link)
#140627 Allow linking rustc and rustdoc against the same single tra… a2715d48950af9c45d50821720052d990188dfc0 (link)
#140630 Async drop source info fix for proxy-drop-coroutine 0c773561a16748ad8a9d74c8be687f50e469a77e (link)

previous master: 13e8790949

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link

github-actions bot commented May 5, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 13e8790 (parent) -> 2958d89 (this PR)

Test differences

Show 116 test diffs

Stage 1

  • [codegen] tests/codegen/const-vector.rs: pass -> [missing] (J0)
  • [codegen] tests/codegen/const-vector.rs#OPT0: [missing] -> pass (J0)
  • [codegen] tests/codegen/const-vector.rs#OPT0_S390X: [missing] -> ignore (only executed when the architecture is s390x) (J0)
  • [ui] tests/ui/rust-2024/unsafe-attributes/safe-proc-macro-attribute.rs#proc_macro_attr: [missing] -> pass (J0)
  • [ui] tests/ui/rust-2024/unsafe-attributes/safe-proc-macro-attribute.rs#unknown_attr: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/rust-2024/unsafe-attributes/safe-proc-macro-attribute.rs#proc_macro_attr: [missing] -> pass (J1)
  • [ui] tests/ui/rust-2024/unsafe-attributes/safe-proc-macro-attribute.rs#unknown_attr: [missing] -> pass (J1)
  • [codegen] tests/codegen/const-vector.rs: pass -> [missing] (J2)
  • [codegen] tests/codegen/const-vector.rs#OPT0: [missing] -> pass (J2)
  • [codegen] tests/codegen/const-vector.rs#OPT0_S390X: [missing] -> ignore (only executed when the architecture is s390x) (J2)

Additionally, 106 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2958d8969cb3096a533927a566e72477c55d8653 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 5251.5s -> 7564.7s (44.0%)
  2. dist-x86_64-apple: 10495.6s -> 7519.0s (-28.4%)
  3. dist-apple-various: 7542.7s -> 5650.0s (-25.1%)
  4. x86_64-apple-2: 5272.3s -> 4010.4s (-23.9%)
  5. x86_64-apple-1: 7321.4s -> 6575.3s (-10.2%)
  6. dist-aarch64-apple: 5080.3s -> 4584.8s (-9.8%)
  7. dist-arm-linux: 5167.0s -> 4690.7s (-9.2%)
  8. dist-i686-linux: 5633.6s -> 5974.7s (6.1%)
  9. dist-various-1: 4595.3s -> 4341.9s (-5.5%)
  10. dist-i686-msvc: 6664.3s -> 6975.1s (4.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@tgross35 tgross35 deleted the rollup-z3hjbm6 branch May 5, 2025 02:30
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2958d89): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Max RSS (memory usage)

Results (primary -0.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [0.5%, 1.9%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.6%, -0.4%] 17
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.6%, 1.9%] 22

Cycles

Results (primary -0.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.0%, -0.4%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-1.0%, 0.5%] 9

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.178s -> 769.681s (0.07%)
Artifact size: 365.41 MiB -> 365.41 MiB (0.00%)

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. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants