-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Rollup of 13 pull requests #144850
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
Closed
Rollup of 13 pull requests #144850
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since it's cfg'd instead of type-aliased
Replace commented-out code with link to context for change. Co-authored-by: Ralf Jung <post@ralfj.de>
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.
This method now returns a string instead of printing directly to (possibly-captured) stdout.
This reduces the amount of "hidden" printing in error-reporting code, which will be helpful when overhauling compiletest's error handling and output capture.
…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`
…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
…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)`.
Do not give function allocations alignment in consteval and Miri. We do not yet have a (clear and T-lang approved) design for how `#[align(N)]` on functions should affect function pointers' addresses on various platforms, so for now do not give function pointers alignment in consteval and Miri. ---- Old summary: Not a full solution to <rust-lang#144661>, but fixes the immediate issue by making function allocations all have alignment 1 in consteval, ignoring `#[rustc_align(N)]`, so the compiler doesn't know if any offset other than 0 is non-null. A more "principlied" solution would probably be to make function pointers to `#[instruction_set(arm::t32)]` functions be at offset 1 of an align-`max(2, align attribute)` allocation instead of at offset 0 of their allocation during consteval, and on wasm to either disallow `#[align(N)]` where N > 1, or to pad the function table such that the function pointer of a `#[align(N)]` function is a multiple of `N` at runtime.
…iler-errors Multiple bounds checking elision failures regression test for rust-lang#120433
…szelmann Port `#[coroutine]` to the new attribute system Related to rust-lang#131229 (comment). r? ````@jdonszelmann````
compiletest: Preliminary cleanup of `ProcRes` printing/unwinding While experimenting with changes to how compiletest handles output capture, error reporting, and unwinding, I repeatedly ran in to difficulties with this core code for reporting test failures caused by a subprocess. There should be no change in compiletest output. r? jieyouxu
…ler-errors `Interner` arg to `EarlyBinder` does not affect auto traits 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. r? compiler-errors
…leLapkin Update E0562 to account for the new impl trait positions fixes rust-lang#142683
…ler-errors Return a struct with named fields from `hash_owner_nodes` While looking through this code for other reasons, I noticed a nice opportunity to return a struct with named fields instead of a tuple. The first patch also introduces an early-return to flatten the rest of `hash_owner_nodes`. There are further changes that could potentially be made here (renaming things, `Option<Hashes>` instead of optional fields), but I'm not deeply familiar with this code so I didn't want to disturb the calling code too much.
Updated test links in compiler Updated test links since a bunch of tests got moved around from the top level recently r? compiler
@bors r+ rollup=never p=5 |
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) - #144070 (Implement `hash_map` macro ) - #144322 (Add lint against dangling pointers from local variables) - #144667 (`AlignmentEnum` should just be `repr(usize)` now) - #144706 (Do not give function allocations alignment in consteval and Miri.) - #144790 (Multiple bounds checking elision failures) - #144794 (Port `#[coroutine]` to the new attribute system) - #144805 (compiletest: Preliminary cleanup of `ProcRes` printing/unwinding) - #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
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors try jobs=dist-x86_64-linux |
rust-bors bot
added a commit
that referenced
this pull request
Aug 3, 2025
Rollup of 13 pull requests try-job: dist-x86_64-linux
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-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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
hash_map
macro #144070 (Implementhash_map
macro )AlignmentEnum
should just berepr(usize)
now #144667 (AlignmentEnum
should just berepr(usize)
now)#[coroutine]
to the new attribute system #144794 (Port#[coroutine]
to the new attribute system)ProcRes
printing/unwinding #144805 (compiletest: Preliminary cleanup ofProcRes
printing/unwinding)Interner
arg toEarlyBinder
does not affect auto traits #144808 (Interner
arg toEarlyBinder
does not affect auto traits)hash_owner_nodes
#144822 (Return a struct with named fields fromhash_owner_nodes
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup