Skip to content

Rollup of 14 pull requests #144844

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

Closed
wants to merge 39 commits into from
Closed

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Aug 3, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

scottmcm and 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

Fixes rust-lang#143009.
Fixes rust-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)
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide 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
Contributor Author

Zalathar commented Aug 3, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 3, 2025

📌 Commit acd53bb has been approved by Zalathar

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

bors commented Aug 3, 2025

⌛ Testing commit acd53bb with merge 05a2257...

bors added a commit that referenced this pull request Aug 3, 2025
Rollup of 14 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)
 - #144779 (Implement debugging output of the bootstrap Step graph into a DOT file)
 - #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
@bors
Copy link
Collaborator

bors commented Aug 3, 2025

💔 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 Aug 3, 2025
@rust-log-analyzer
Copy link
Collaborator

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

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

@Zalathar Zalathar closed this Aug 3, 2025
@rustbot rustbot 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-2csfgl2 branch August 3, 2025 03:52
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.