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 7 pull requests #128614

Merged
merged 16 commits into from
Aug 3, 2024
Merged

Rollup of 7 pull requests #128614

merged 16 commits into from
Aug 3, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

spastorino and others added 16 commits July 23, 2024 00:29
the bug was caused by two factors:
1. only checking the RUST_TARGET_PATH form, not the full filepath form
2. indirectly trying to use the Debug presentation to get the file path
…` and aren't accidentally usable on completely unrelated HIR nodes

Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
…-blocks, r=compiler-errors

Stabilize unsafe extern blocks (RFC 3484)

# Stabilization report

## Summary

This is a tracking issue for the RFC 3484: Unsafe Extern Blocks

We are stabilizing `#![feature(unsafe_extern_blocks)]`, as described in [Unsafe Extern Blocks RFC 3484](rust-lang/rfcs#3484). This feature makes explicit that declaring an extern block is unsafe. Starting in Rust 2024, all extern blocks must be marked as unsafe. In all editions, items within unsafe extern blocks may be marked as safe to use.

RFC: rust-lang/rfcs#3484
Tracking issue: rust-lang#123743

## What is stabilized

### Summary of stabilization

We now need extern blocks to be marked as unsafe and items inside can also have safety modifiers (unsafe or safe), by default items with no modifiers are unsafe to offer easy migration without surprising results.

```rust
unsafe extern {
    // sqrt (from libm) may be called with any `f64`
    pub safe fn sqrt(x: f64) -> f64;

    // strlen (from libc) requires a valid pointer,
    // so we mark it as being an unsafe fn
    pub unsafe fn strlen(p: *const c_char) -> usize;

    // this function doesn't say safe or unsafe, so it defaults to unsafe
    pub fn free(p: *mut core::ffi::c_void);

    pub safe static IMPORTANT_BYTES: [u8; 256];

    pub safe static LINES: SyncUnsafeCell<i32>;
}
```

## Tests

The relevant tests are in `tests/ui/rust-2024/unsafe-extern-blocks`.

## History

- rust-lang#124482
- rust-lang#124455
- rust-lang#125077
- rust-lang#125522
- rust-lang#126738
- rust-lang#126749
- rust-lang#126755
- rust-lang#126757
- rust-lang#126758
- rust-lang#126756
- rust-lang#126973
- rust-lang#127535
- rust-lang/rustfmt#6204

## Unresolved questions

I am not aware of any unresolved questions.
…et, r=albertlarsan68

bootstrap: fix bug preventing the use of custom targets

the bug was caused by two factors:
1. only checking the RUST_TARGET_PATH form, not the full filepath form
2. indirectly trying to use the Debug presentation to get the file path
Implement `UncheckedIterator` directly for `RepeatN`

This just pulls the code out of `next` into `next_unchecked`, rather than making the `Some` and `unwrap_unchecked`ing it.

And while I was touching it, I added a codegen test that `array::repeat` for something that's just `Clone`, not `Copy`, still ends up optimizing to the same thing as `[x; n]`: <https://rust.godbolt.org/z/YY3a5ajMW>.
…n-panic, r=tgross35

chore: refactor backtrace style in panic

# Refactor get_backtrace_style for better readability and potential performance improvements

This PR aims to improve the readability and maintainability of the `set_backtrace_style` and `get_backtrace_style` function.
…triddle

Simplify `body` usage in rustdoc

No changes, just a little less code.

r? `@notriddle`
Assert that all attributes are actually checked via `CheckAttrVisitor` and aren't accidentally usable on completely unrelated HIR nodes

``@oli-obk's`` rust-lang#128444 with unreachable case removed to avoid that PR bitrotting away.
Based on rust-lang#128402.

This PR will make adding a new attribute ICE on any use of that attribute unless it gets a handler added in `rustc_passes::CheckAttrVisitor`.

r? ``@nnethercote`` (since you were the reviewer of the original PR)
Update run-make/used to use `any_symbol_contains`

This makes it so we don't need `nm` or `llvm-nm`.

I also tested that `BAR` is removed. I'm not sure if this is wanted though.
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 3, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Aug 3, 2024

📌 Commit 0655ed2 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 Aug 3, 2024
@bors
Copy link
Contributor

bors commented Aug 3, 2024

⌛ Testing commit 0655ed2 with merge 64ebd39...

@bors
Copy link
Contributor

bors commented Aug 3, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 64ebd39 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 3, 2024
@bors bors merged commit 64ebd39 into rust-lang:master Aug 3, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 3, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#127921 Stabilize unsafe extern blocks (RFC 3484) 6841bd34de5dcfdae38583d02b767cc55ff92291 (link)
#128283 bootstrap: fix bug preventing the use of custom targets ea84bf20b38cba9f9ff0d53afe6c2b552bae5ad7 (link)
#128530 Implement UncheckedIterator directly for RepeatN be145f3b7cc34e196e110d119eb40bd051aed6ef (link)
#128551 chore: refactor backtrace style in panic 72ff5bd9282468309b65f94a37e62497a969f052 (link)
#128573 Simplify body usage in rustdoc 3cc223c0f57e012e7650bbc2fae5ac4d52ca508e (link)
#128581 Assert that all attributes are actually checked via `CheckA… a008b38c660a0c44736525df7e124b0b11a60f1d (link)
#128603 Update run-make/used to use any_symbol_contains 5a5615f70a9706c68a9faed2e0c8ac31a7fa9b10 (link)

previous master: bbf60c897e

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

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  PR_MESSAGE: Automation to keep dependencies in `Cargo.lock` current.
following is the output from `cargo update`:
  COMMIT_MESSAGE: cargo update 
##[endgroup]
info: syncing channel updates for 'beta-2024-07-26-x86_64-unknown-linux-gnu'
info: latest update on 2024-07-26, rust version 1.81.0-beta.2 (08328a323 2024-07-25)
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rust-std'
info: installing component 'rustc'

  beta-2024-07-26-x86_64-unknown-linux-gnu installed - rustc 1.81.0-beta.2 (08328a323 2024-07-25)

info: using existing install for 'beta-2024-07-26-x86_64-unknown-linux-gnu'
info: default toolchain set to 'beta-2024-07-26-x86_64-unknown-linux-gnu'

  beta-2024-07-26-x86_64-unknown-linux-gnu unchanged - rustc 1.81.0-beta.2 (08328a323 2024-07-25)

##[group]Run cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
---
    Updating zerocopy v0.7.34 -> v0.7.35
    Updating zerocopy-derive v0.7.34 -> v0.7.35
    Updating zerovec v0.10.2 -> v0.10.4
    Updating zerovec-derive v0.10.2 -> v0.10.3
note: pass `--verbose` to see 91 unchanged dependencies behind latest
##[group]Run echo -e "\nrustbook dependencies:" >> cargo_update.log
echo -e "\nrustbook dependencies:" >> cargo_update.log
cargo update --manifest-path src/tools/rustbook 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log

@matthiaskrgr
Copy link
Member Author

huh?

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (64ebd39): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.4%, 1.3%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (secondary 2.1%)

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
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (secondary 0.0%)

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
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 758.56s -> 756.925s (-0.22%)
Artifact size: 336.83 MiB -> 336.81 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 4, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Aug 5, 2024

The cause is #127921. Since this adds new functionality/checking, it's more work done by the compiler. Marking as triaged.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 5, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-d2fextz branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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-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. 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.