- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Rollup of 13 pull requests #144845
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 #144845
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
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)
…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` fixes rust-lang#135038 r? ``@WaffleLapkin`` (since bot will ping you anyway, feel free to reroll)
| @bors r+ rollup=never p=5 | 
| Subset of #144844. | 
    
  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
| The job  Click to see the possible cause of the failure (guessed by this bot) | 
| 💔 Test failed - checks-actions | 
  
    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-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:
should_panicdoctest attribute and fix--no-runtest flag on the 2024 edition #143900 ([rustdoc] Correctly handleshould_panicdoctest attribute and fix--no-runtest flag on the 2024 edition)hash_mapmacro #144070 (Implementhash_mapmacro )AlignmentEnumshould just berepr(usize)now #144667 (AlignmentEnumshould just berepr(usize)now)#[coroutine]to the new attribute system #144794 (Port#[coroutine]to the new attribute system)Internerarg toEarlyBinderdoes not affect auto traits #144808 (Internerarg toEarlyBinderdoes 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