Commit Graph

321925 Commits

Author SHA1 Message Date
zedddie 98d259beaf add min_adt_const_params gate tests 2026-04-02 17:10:41 +02:00
bors 212ef7770d Auto merge of #154366 - bjorn3:sync_cg_clif-2026-03-25, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlights this time are a bunch of inline asm fixes for graviola and a Cranelift update.

r? @ghost

@rustbot label +A-codegen +A-cranelift +T-compiler +subtree-sync
2026-03-25 16:52:48 +00:00
bors 64d5cb603b Auto merge of #149218 - theemathas:pin-coerce-unsized, r=oli-obk
Make PinCoerceUnsized require Deref



Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized on such types makes no sense.

This is a breaking change, since stable code can observe the deleted `PinCoerceUnsized` impls by uselessly coercing between such types inside a `Pin`.

There is still some strange behavior, such as `Pin<&mut i32>` being able to coerce to `Pin<&dyn Send>`, but not being able to coerce to `Pin<&i32>`. However, I don't think it's possible to fix this.

Fixes https://github.com/rust-lang/rust/issues/145081
2026-03-25 13:07:28 +00:00
bjorn3 d7f7241eb2 Update tidy allowed deps list 2026-03-25 11:48:54 +01:00
bjorn3 a6e0f6a137 Merge commit '493d427c7d3423f085f05179e36a35b4943b1379' into sync_cg_clif-2026-03-25 2026-03-25 11:43:04 +01:00
bjorn3 493d427c7d Rustup to rustc 1.96.0-nightly (362211dc2 2026-03-24) 2026-03-25 11:18:17 +01:00
bjorn3 8126ccb64f Sync from rust 362211dc29 2026-03-25 11:15:07 +01:00
Theemathas Chirananthavat f55c8cca4c Rewrite safety comment for PinCoerceUnsized 2026-03-25 11:40:27 +07:00
Theemathas Chirananthavat 1e4c1d6f75 Make PinCoerceUnsized require Deref
Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized
on such types makes no sense.

This is a breaking change, since stable code can observe the deleted
`PinCoerceUnsized` impls by uselessly coercing between such types
inside a `Pin`.

There is still some strange behavior, such as `Pin<&mut i32>` being
able to coerce to `Pin<&dyn Send>`, but not being able to coerce to
`Pin<&i32>`. However, I don't think it's possible to fix this.

Fixes https://github.com/rust-lang/rust/issues/145081
2026-03-25 11:40:27 +07:00
bors 8a703520e8 Auto merge of #154339 - JonathanBrouwer:rollup-FPeeGxJ, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#154311 ([libcore] Disable `doc(auto_cfg)` for integers trait impls)
 - rust-lang/rust#154331 (allow `incomplete_features` in all ui tests)
 - rust-lang/rust#154336 (Remove more BuiltinLintDiag variants - part 3)
2026-03-24 22:00:08 +00:00
Jonathan Brouwer d54a564510 Rollup merge of #154336 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Remove more BuiltinLintDiag variants - part 3

Part of https://github.com/rust-lang/rust/issues/153099.

Last part of the "easy" migration.

r? @JonathanBrouwer
2026-03-24 22:36:57 +01:00
Jonathan Brouwer 22f3a5dd29 Rollup merge of #154331 - cyrgani:incomplete-3, r=JonathanBrouwer
allow `incomplete_features` in all ui tests

This PR allows the `incomplete_features` lint for the `specialization` directory, thereby allowing it for all UI tests.

Followup to rust-lang/rust#154174 and rust-lang/rust#154276.
Closes https://github.com/rust-lang/rust/issues/154168.
2026-03-24 22:36:57 +01:00
Jonathan Brouwer f9f6c97d8b Rollup merge of #154311 - GuillaumeGomez:fix-integer-doc-cfg, r=eggyal,tgross35
[libcore] Disable `doc(auto_cfg)` for integers trait impls

Fixes rust-lang/rust#153655.

Thanks to https://github.com/rust-lang/rust/pull/153964, `doc(auto_cfg)` finally works as expected on impls. So now this fix works:

<img width="1000" height="806" alt="image" src="https://github.com/user-attachments/assets/f37da375-c2eb-4a7b-abf2-1fdd3a73e2bb" />

cc @eggyal
2026-03-24 22:36:56 +01:00
cyrgani 97e84d5a56 allow incomplete_features in all ui tests 2026-03-24 20:00:26 +00:00
Guillaume Gomez c17dec615d Remove BuiltinLintDiag usage in rustc_metadata 2026-03-24 19:45:17 +01:00
bors 362211dc29 Auto merge of #154326 - JonathanBrouwer:rollup-MflIdQW, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#152710 (Unalign `PackedFingerprint` on all hosts, not just x86 and x86-64)
 - rust-lang/rust#153874 (constify const Fn*: Destruct)
 - rust-lang/rust#154097 (improve validation error messages: show surrounding type)
 - rust-lang/rust#154277 (use `minicore` more in testing inline assembly)
 - rust-lang/rust#154293 (Use verbose span suggestion for type const)
2026-03-24 18:37:19 +00:00
Jonathan Brouwer 9396ab225e Rollup merge of #154293 - reddevilmidzy:type-diag, r=fmease
Use verbose span suggestion for type const

close: https://github.com/rust-lang/rust/issues/154214

r? fmease
2026-03-24 18:14:18 +01:00
Jonathan Brouwer ef18725442 Rollup merge of #154277 - folkertdev:ui-asm-minicore, r=jieyouxu
use `minicore` more in testing inline assembly

Both for easier development and because some niche assembly features were only tested on one platform.

try-job: aarch64-gnu
try-job: x86_64-gnu
try-job: x86_64-gnu-debug
2026-03-24 18:14:17 +01:00
Jonathan Brouwer ab6401749a Rollup merge of #154097 - RalfJung:validity-error, r=oli-obk
improve validation error messages: show surrounding type

Also, for dyn-downcast show the type we're downcasting to.

r? @oli-obk
2026-03-24 18:14:15 +01:00
Jonathan Brouwer 1e3d3bdb24 Rollup merge of #153874 - bend-n:constify-const-fn-destruct, r=oli-obk
constify const Fn*: Destruct

makes closures const destruct where their upvars are. i think this makes sense
and is how this should be implemented.

r? @oli-obk
2026-03-24 18:14:15 +01:00
Jonathan Brouwer 65097900fd Rollup merge of #152710 - Zalathar:unalign-fingerprint, r=fmease
Unalign `PackedFingerprint` on all hosts, not just x86 and x86-64

Back in https://github.com/rust-lang/rust/pull/78646, `DepNode` was modified to store an unaligned `PackedFingerprint` instead of an 8-byte-aligned `Fingerprint`. That reduced the size of DepNode from 24 bytes to 17 bytes (nowadays 18 bytes), resulting in considerable memory savings in incremental builds.

See https://github.com/rust-lang/rust/pull/152695#issuecomment-3907091509 for a benchmark demonstrating the impact of *removing* that optimization.

At the time (and today), the unaligning was only performed on x86 and x86-64 hosts, because those CPUs are known to generally have low overhead for unaligned memory accesses. Hosts with other CPU architectures would continue to use an 8-byte-aligned fingerprint and a 24-byte DepNode.

Given the subsequent rise of aarch64 (especially on macOS) and other architectures, it's a shame that some commonly-used builds of rustc don't get those memory-size benefits, based on a decision made several years ago under different circumstances.

We don't have benchmarks to show the actual effect of unaligning DepNode fingerprints on various non-x86 hosts, but it seems very likely to be a good idea on Apple chips, and I have no particular reason to think that it will be catastrophically bad on other hosts. And we don't typically perform this kind of speculative pessimization in other parts of the compiler.
2026-03-24 18:14:14 +01:00
bors 63154b7b47 Auto merge of #154316 - JonathanBrouwer:rollup-qSafo91, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#154094 (add neon load/store assembly test)
 - rust-lang/rust#154142 (Delegation: eliminate usage of AST from generics creation)
 - rust-lang/rust#154276 (allow `incomplete_features` in more tests)
 - rust-lang/rust#154284 (doc: linker-plugin-based LTO: update list of good combinations)
 - rust-lang/rust#154286 (Cherry-pick 1.94.1 release notes)
 - rust-lang/rust#154303 (Remove more `BuiltinLintDiag` variants - part 2)
2026-03-24 15:25:04 +00:00
Jonathan Brouwer a5327061eb Rollup merge of #154303 - GuillaumeGomez:migrate-diag2, r=JonathanBrouwer
Remove more `BuiltinLintDiag` variants - part 2

Part of https://github.com/rust-lang/rust/issues/153099.

r? @JonathanBrouwer
2026-03-24 16:22:52 +01:00
Jonathan Brouwer a77ea21587 Rollup merge of #154286 - Mark-Simulacrum:relnotes, r=jieyouxu
Cherry-pick 1.94.1 release notes

This also fixes the Cargo rendering bug noted in the pre-release thread (https://internals.rust-lang.org/t/rust-1-94-1-pre-release-testing/24107/2).
2026-03-24 16:22:51 +01:00
Jonathan Brouwer eb7fa12d76 Rollup merge of #154284 - zamazan4ik:patch-1, r=JohnTitor
doc: linker-plugin-based LTO: update list of good combinations

This PR is similar to https://github.com/rust-lang/rust/pull/146827 . I just ran the Python script as was [recommended](https://github.com/rust-lang/rust/pull/146827#pullrequestreview-3255349459) in this comment. Also updated the LOWER_BOUND in the script to skip a bit redundant work in the Python script.

@nnethercote pinging you as a reviewer here since the last time you did it too ;)
2026-03-24 16:22:50 +01:00
Jonathan Brouwer a1c32ca566 Rollup merge of #154276 - cyrgani:incomplete-mcp-2, r=fmease
allow `incomplete_features` in more tests

This PR allows the `incomplete_features` lint for the `traits` and `const-generics` directories. `specialization` will come in a followup PR.

Followup to rust-lang/rust#154174.
Part of https://github.com/rust-lang/rust/issues/154168.
2026-03-24 16:22:50 +01:00
Jonathan Brouwer 1cfbc509e6 Rollup merge of #154142 - aerooneqq:dont-create-ast-generics-2, r=petrochenkov
Delegation: eliminate usage of AST from generics creation

This PR eliminates all interaction with AST during creation of generics, then it supports proper const param types propagation. Fixes rust-lang/rust#153433. Fixes rust-lang/rust#153499. Part of rust-lang/rust#118212.

r? @petrochenkov
2026-03-24 16:22:49 +01:00
Jonathan Brouwer 898b62f590 Rollup merge of #154094 - folkertdev:aarch64-arm-load-store, r=sayantn
add neon load/store assembly test

I'm adding this test because it was requested for the beta backport of https://github.com/rust-lang/rust/issues/153336. We'd like to test this with Miri, but currently there is no load/store pair that roundtrips because one or the other still uses the platform-specific intrinsics.

r? sayantn

I believe test-various runs some arm and android tests?

@bors try job=test-various
2026-03-24 16:22:49 +01:00
Redddy e03983878f Use verbose span suggestion for type const 2026-03-24 15:02:10 +00:00
Guillaume Gomez 24295bf7ae Disable doc(auto_cfg) for integers trait impls 2026-03-24 14:23:41 +01:00
aerooneqq 1d325ce436 Eliminate usage of AST from generics creation 2026-03-24 14:16:36 +03:00
bors 0312931d8c Auto merge of #154300 - JonathanBrouwer:rollup-MkFxTPv, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153434 (Use a safe `BucketIndex` abstraction in `VecCache`)
 - rust-lang/rust#154133 (Defer codegen for the VaList Drop impl to actual uses)
 - rust-lang/rust#154297 (fix/extend some mir-opt comments)
 - rust-lang/rust#154299 (document some functions on AttributeExt)
2026-03-24 11:14:58 +00:00
Guillaume Gomez 5d7f89417c Remove more BuiltinLintDiag in rustc_resolve 2026-03-24 11:47:03 +01:00
Guillaume Gomez 45027f1788 Remove more BuiltinLintDiag in rustc_middle 2026-03-24 11:47:03 +01:00
Guillaume Gomez eba0efd9aa Remove more BuiltinLintDiag in rustc_attr_parsing 2026-03-24 11:47:03 +01:00
Jonathan Brouwer 6f67067c6f Rollup merge of #154299 - jdonszelmann:document-attribute-ext, r=JonathanBrouwer
document some functions on AttributeExt

r? @jyn514
2026-03-24 10:54:05 +01:00
Jonathan Brouwer f51c96a5a0 Rollup merge of #154133 - bjorn3:va_list_drop_defer_codegen, r=nnethercote
Defer codegen for the VaList Drop impl to actual uses

This allows compiling libcore with codegen backends that don't actually implement VaList like cg_clif.
2026-03-24 10:54:04 +01:00
Jonathan Brouwer a5a286df89 Rollup merge of #154297 - RalfJung:mir-opt-comments, r=dianqk
fix/extend some mir-opt comments

Looks like CopyProp was refactored without updating that comment.

And for GVN, I think this is what you had in mind @cjgillot but would be great if you could have a look.
2026-03-24 10:54:04 +01:00
Jonathan Brouwer fad2a35ebf Rollup merge of #154133 - bjorn3:va_list_drop_defer_codegen, r=nnethercote
Defer codegen for the VaList Drop impl to actual uses

This allows compiling libcore with codegen backends that don't actually implement VaList like cg_clif.
2026-03-24 10:54:04 +01:00
Jonathan Brouwer f02eaf6ea5 Rollup merge of #153434 - Zalathar:bucket-index, r=nnethercote
Use a safe `BucketIndex` abstraction in `VecCache`

The current code for indexing into bucket arrays is quite tricky and unsafe, partly because it has to keep manually assuring the compiler that a bucket index is always less than 21.

By encapsulating that knowledge in a 21-value enum, we can make the code clearer and safer, without giving up performance.

Having a dedicated `BucketIndex` type could also help with further cleanups of `VecCache` indexing.
2026-03-24 10:54:03 +01:00
bjorn3 366cf883c7 Add comments 2026-03-24 10:01:46 +01:00
Jana Dönszelmann c87cd68568 document some functions on AttributeExt 2026-03-24 09:29:26 +01:00
bors cde9cf08d7 Auto merge of #151063 - sgasho:aarch64-dist-enzyme, r=ZuseZ4
Link LLVM dynamically on aarch64-apple-darwin



Follow-up to rust-lang/rust#152768.

* Link LLVM dynamically on MacOS
* Fix a macOS LLVM dylib name mismatch
2026-03-24 08:05:38 +00:00
Ralf Jung fb2b0031d0 GVN: add clarifying example to reference comment 2026-03-24 08:59:29 +01:00
Ralf Jung bd16cd4fb5 CopyProp: fix outdated comment 2026-03-24 08:12:17 +01:00
Zalathar fd3b22a836 Use a safe BucketIndex abstraction in VecCache
The current code for indexing into bucket arrays is quite tricky and unsafe,
partly because it has to keep manually assuring the compiler that a bucket
index is always less than 21.

By encapsulating that knowledge in a 21-value enum, we can make the code
clearer and safer, without giving up performance.

Having a dedicated `BucketIndex` type could also help with further cleanups of
`VecCache` indexing.
2026-03-24 17:52:09 +11:00
bors 9df83179a4 Auto merge of #154289 - jhpratt:rollup-JFDweJT, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#153964 (Fix `doc_cfg` not working as expected on trait impls)
 - rust-lang/rust#153979 (Rename various query cycle things.)
 - rust-lang/rust#154132 (Add missing num_internals feature gate to coretests/benches)
 - rust-lang/rust#154153 (core: Implement `unchecked_funnel_{shl,shr}`)
 - rust-lang/rust#154236 (Clean up query-forcing functions)
 - rust-lang/rust#154252 (Don't store current-session side effects in `OnDiskCache`)
 - rust-lang/rust#154017 ( Fix invalid add of duplicated call locations for the rustdoc scraped examples feature)
 - rust-lang/rust#154163 (enzyme submodule update)
 - rust-lang/rust#154264 (Update books)
 - rust-lang/rust#154282 (rustc-dev-guide subtree update)
2026-03-24 04:54:28 +00:00
Jacob Pratt 04975e4182 Rollup merge of #154282 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/a9f3e8e687116a6e733bea8bd461c65861182f45.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-23 23:42:53 -04:00
Jacob Pratt 3574d5748e Rollup merge of #154264 - rustbot:docs-update, r=ehuss
Update books

## rust-embedded/book

1 commits in e88aa4403b4bf2071c8df9509160477e40179099..2463edeb8003c5743918b3739a9f6870b86396f5
2026-03-11 17:49:58 UTC to 2026-03-11 17:49:58 UTC

- Update teaching material duration for bare-metal Rust (rust-embedded/book#409)

## rust-lang/reference

7 commits in c49e89cc8c7c2c43ca625a8d5b7ad9a53a9ce978..7446bf9697c95d155eef33c6a9d91fbd29a5e359
2026-03-18 01:46:01 UTC to 2026-03-10 18:10:22 UTC

- Update `must_use` to use the attribute template (rust-lang/reference#1892)
- Add a rule that enum discriminants may not use generic parameters (rust-lang/reference#2206)
- Actually move out of Box in moving-out-of-Box test (rust-lang/reference#2204)
- Add special cases and links relating to dereferencing boxes (rust-lang/reference#2075)
- Move shebang into its own subchapter (rust-lang/reference#2199)
- Fields of enums and unions should be allowed to overlap (rust-lang/reference#2168)
- [type layout] Clarify size and alignment of pointers to unsized types (rust-lang/reference#2201)
2026-03-23 23:42:52 -04:00
Jacob Pratt f098563a64 Rollup merge of #154163 - ZuseZ4:update-enzyme-march-21-2026, r=oli-obk
enzyme submodule update

Brings a bugfix for https://github.com/EnzymeAD/Enzyme/issues/2492, which had shown up in multiple independent Rust programs.

r? @oli-obk
2026-03-23 23:42:52 -04:00