Skip to content

Rollup of 13 pull requests - #144845

Closed
Zalathar wants to merge 36 commits into
rust-lang:masterfrom
Zalathar:rollup-g8dizgm
Closed

Rollup of 13 pull requests#144845
Zalathar wants to merge 36 commits into
rust-lang:masterfrom
Zalathar:rollup-g8dizgm

Conversation

@Zalathar

@ZalatharZalathar commented Aug 3, 2025

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

scottmcmand others added 30 commits July 30, 2025 00:09
Since it's cfg'd instead of type-aliased
Conceptually `EarlyBinder` does not contain an `Interner` so it shouldn't tell Rust it does via `PhantomData`.
This is necessary for rust-analyzer as it stores `EarlyBinder`s in query results which require `Sync`, placing restrictions on our interner setup.
…zelmann
Port #[macro_export] to the new attribute parsing infrastructure
Ports macro_export to the new attribute parsing infrastructure for rust-lang#131229 (comment)
r? ``@oli-obk``
cc ``@JonathanBrouwer`` ``@jdonszelmann``
…narycat,fmease
[rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition
Fixesrust-lang#143009.
Fixesrust-lang#143858.
Since it includes fixes from rust-lang#143453, it's taking it over (commits 2, 3 and 4 are from rust-lang#143453).
For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit.
For `should_panic` fix, the exit code check has been fixed.
cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!)
r? `@notriddle`
…Noratrieb
Implement `hash_map` macro
Implementation of rust-lang#144032
Implements the `hash_map` macro under `std/src/macros.rs`.
…oli-obk
Add lint against dangling pointers from local variables
## `dangling_pointers_from_locals`
*warn-by-default*
The `dangling_pointers_from_locals` lint detects getting a pointer to data of a local that will be dropped at the end of the function.
### Example
```rust
fn f() -> *const u8 {
let x = 0;
&x // returns a dangling ptr to `x`
}
```
```text
warning: a dangling pointer will be produced because the local variable `x` will be dropped
--> $DIR/dangling-pointers-from-locals.rs:10:5
|
LL | fn simple() -> *const u8 {
| --------- return type of the function is `*const u8`
LL | let x = 0;
| - `x` is defined inside the function and will be drop at the end of the function
LL | &x
| ^^
|
= note: pointers do not have a lifetime; after returning, the `u8` will be deallocated at the end of the function because nothing is referencing it as far as the type system is concerned
= note: `#[warn(dangling_pointers_from_locals)]` on by default
```
### Explanation
Returning a pointer from a local value will not prolong its lifetime, which means that the value can be dropped and the allocation freed while the pointer still exists, making the pointer dangling.
If you need stronger guarantees, consider using references instead, as they are statically verified by the borrow-checker to never dangle.
------
This is related to GitHub codeql [CWE-825](https://github.com/github/codeql/blob/main/rust/ql/src/queries/security/CWE-825/AccessAfterLifetimeBad.rs) which shows examples of such simple miss-use.
It should be noted that C compilers warns against such patterns even without `-Wall`, https://godbolt.org/z/P7z98arrc.
------
``@rustbot`` labels +I-lang-nominated +T-lang
cc ``@traviscross``
r? compiler
…r-width, r=Noratrieb
Make target pointer width in target json an integer
r? Noratrieb
cc ``@RalfJung`` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)
…oss35
`AlignmentEnum` should just be `repr(usize)` now
These used to use specific sizes because they were compiled on all widths. But now that the types themselves are `#[cfg]`'d, we can save some conversions by having it always be `repr(usize)`.
…iler-errors
Multiple bounds checking elision failures
regression test for rust-lang#120433
Use full flag name in strip command for Darwin
Darwin always uses `rust-objcopy` which supports long-form flags
Solaris unchanged due to not having support for `--discard-all` and only `-x`
fixesrust-lang#135038
r? ``@WaffleLapkin`` (since bot will ping you anyway, feel free to reroll)
@rustbotrustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc 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-clippy Relevant to the Clippy team. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Aug 3, 2025
@Zalathar

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@bors

bors commented Aug 3, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 490cde5 has been approved by Zalathar

It is now in the queue for this repository.

@borsbors 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, 2025
@Zalathar

Copy link
Copy Markdown
MemberAuthor

Subset of #144844.

@bors

bors commented Aug 3, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 490cde5 with merge 922a42b...

bors added a commit that referenced this pull request Aug 3, 2025
Rollup of 13 pull requests
Successful merges:
- #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
- #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
- #144070 (Implement `hash_map` macro )
- #144322 (Add lint against dangling pointers from local variables)
- #144443 (Make target pointer width in target json an integer)
- #144667 (`AlignmentEnum` should just be `repr(usize)` now)
- #144790 (Multiple bounds checking elision failures)
- #144794 (Port `#[coroutine]` to the new attribute system)
- #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits)
- #144816 (Update E0562 to account for the new impl trait positions)
- #144822 (Return a struct with named fields from `hash_owner_nodes`)
- #144824 (Updated test links in compiler)
- #144829 (Use full flag name in strip command for Darwin)
r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::RemoteCopyLibs { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
##[group]Testing stage0 compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu)
thread 'main' panicked at src/tools/compiletest/src/common.rs:924:10:
called `Result::unwrap()` on an `Err` value: Error("invalid type: string \"64\", expected u32", line: 60, column: 32)
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:697:5
1: core::panicking::panic_fmt
at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:75:14
2: core::result::unwrap_failed
at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/result.rs:1761:5
3: <compiletest::common::TargetCfgs>::new
4: <std::sync::poison::once::Once>::call_once_force::<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::initialize<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::get_or_init<<compiletest::common::Config>::target_cfgs::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0}
5: std::sys::sync::once::futex::Once::call
at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/sys/sync/once/futex.rs:176:21
6: <std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::initialize::<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::get_or_init<<compiletest::common::Config>::target_cfgs::{closure#0}>::{closure#0}, !>
7: <compiletest::directives::needs::CachedNeedsConditions>::load
8: compiletest::run_tests
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:29:27
local time: Sun Aug 3 04:34:26 UTC 2025
network time: Sun, 03 Aug 2025 04:34:26 GMT

@bors

bors commented Aug 3, 2025

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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 Aug 3, 2025
@ZalatharZalathar closed this Aug 3, 2025
@rustbotrustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2025
@Zalathar
Zalathar deleted the rollup-g8dizgm branch August 3, 2025 05:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-compiletestArea: The compiletest test runnerA-run-makeArea: port run-make Makefiles to rmake.rsA-rustdoc-jsonArea: Rustdoc JSON backendA-testsuiteArea: The testsuite used to check the correctness of rustcrollupA PR which is a rollupT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-clippyRelevant to the Clippy team.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

15 participants

@Zalathar@bors@rust-log-analyzer@rustbot@scottmcm@Urgau@WaffleLapkin@Periodic1911@lucarlig@GuillaumeGomez@stifskere@Veykril@scrabsha@Noratrieb@Kivooeo