324986 Commits

Author SHA1 Message Date
Zalathar 1e8cd1f7a6 Support //@ skip-filecheck in codegen and assembly tests
Skipping FileCheck in codegen/assembly tests is normally not very useful, but a
small number of existing tests were using `//@ build-pass` to do so anyway, so
it's clearer for them to explicitly use `//@ skip-filecheck` instead.
2026-04-22 19:55:27 +10:00
Zalathar eb6eed4ba7 Make //@ skip-filecheck a normal compiletest directive 2026-04-22 19:55:11 +10:00
Daria Sukhonina fa4d2ad671 Clarify behavior of ShardedHashMap::insert_unique 2026-04-22 12:39:19 +03:00
dianqk 10d8329061 codegen: Copy to an alloca when the argument is neither by-val nor by-move for indirect pointer. 2026-04-22 17:37:17 +08:00
dianqk e67e7162f7 Add miscompiled test cases 2026-04-22 17:36:33 +08:00
Folkert de Vries 5149a31515 change llvm.ptrmask argument to isize
we were saying that the type is i32, but would often provide an i64.
That never failed so far, but starts failing (like, crashing LLVM) when
working with 128-bit values that are 16-byte aligned. So, we may as well
use the more robust approach now.
2026-04-22 10:32:27 +02:00
Tshepang Mbambo f9566d6b10 Merge pull request #2844 from rust-lang/aj/rustc-internals-docs-clarity
Mentions rustc-docs for rustc_private
2026-04-22 09:50:10 +02:00
lapla 9be8fca54e Fix ICE when const closure appears inside a non-const trait method 2026-04-22 15:41:31 +09:00
bors cf1817bc6e Auto merge of #155634 - jhpratt:rollup-lo99oO5, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#155589 (Forbid `check-pass`/`build-pass`/`run-pass` directives in incremental tests)
 - rust-lang/rust#155610 (Add missing `dyn` keyword to `trait_alias` page of the Unstable Book)
 - rust-lang/rust#155615 (test cleanups for `ui/derives` and `ui/deriving`)
 - rust-lang/rust#154874 (Fix ICE for inherited const conditions on const closures)
 - rust-lang/rust#155605 (std: Update support for `wasm32-wasip3`)
 - rust-lang/rust#155613 (c-variadic: tweak `std` docs)
 - rust-lang/rust#155619 (Remove a bunch of unnecessary explicit lifetimes from the ast validator)
2026-04-22 06:20:12 +00:00
Jacob Pratt 6fa2b1d01a Rollup merge of #155619 - oli-obk:ast-validation-lifetimes, r=dingxiangfei2009
Remove a bunch of unnecessary explicit lifetimes from the ast validator

Noticed while fiddling with error reporting. None of the lifetimes were ever used for anything
2026-04-22 01:53:43 -04:00
Jacob Pratt 48f36eda77 Rollup merge of #155613 - folkertdev:c-variadic-doc-tweaks, r=tgross35
c-variadic: tweak `std` docs

tracking issue: https://github.com/rust-lang/rust/issues/44930

In preparation of a rename of `arg` to `next_arg`

cc @workingjubilee
r? tgross35
2026-04-22 01:53:42 -04:00
Jacob Pratt 6c0cbcf038 Rollup merge of #155605 - alexcrichton:wasip3, r=jhpratt
std: Update support for `wasm32-wasip3`

This commit performs some minor update within the standard library for the `wasm32-wasip3` target. This target is a tier 3 target currently due to the WASIp3 specification not being officially released. This commit adds a dependency from the standard library on the `wasip3` crate in the same manner as the `wasip1` and `wasip2` crates that it already depends on. The use-sites, for randomness and environment variables, are then updated to handle the wasip2/wasip3 multiplexing.
2026-04-22 01:53:42 -04:00
Jacob Pratt b622dd00fb Rollup merge of #154874 - cijiugechu:fix-const-closure-inherited-conditions, r=oli-obk
Fix ICE for inherited const conditions on const closures

Synchronize `evaluate_host_effect_for_fn_goal` with the behavior of `extract_fn_def_from_const_callable` in new solver.

Closes rust-lang/rust#153861 .
2026-04-22 01:53:41 -04:00
Jacob Pratt ca4aaafbf2 Rollup merge of #155615 - cyrgani:clean-deriving, r=Kivooeo
test cleanups for `ui/derives` and `ui/deriving`

The eventual goal is for `ui/deriving` to be merged into `ui/derives` entirely. This PR focuses on the `issue-*.rs` tests in `deriving` and a few other no-longer-useful tests.
r? @Kivooeo
2026-04-22 01:53:40 -04:00
Jacob Pratt 0ab2cdf261 Rollup merge of #155610 - Omnikar:trait-alias-docs-fix, r=mejrs
Add missing `dyn` keyword to `trait_alias` page of the Unstable Book

There seemed to be a small typo in the Rust Unstable Book page for the `trait_alias` feature, where a variable is declared as `&Bar` for a trait `Bar`, rather than `&dyn Bar`.
2026-04-22 01:53:39 -04:00
Jacob Pratt 2a68b22174 Rollup merge of #155589 - Zalathar:cpass, r=jieyouxu
Forbid `check-pass`/`build-pass`/`run-pass` directives in incremental tests

- Follow-up to https://github.com/rust-lang/rust/pull/155474
---

This PR forbids the use of `//@ check-pass`, `//@ build-pass`, and `//@ run-pass` directives in incremental tests. Tests that would have used those directives should use a revision name beginning with `cpass`/`bpass`/`rpass` instead.

(The `*-fail` directives are already forbidden in incremental tests.)

Existing incremental tests that used the `check-pass` and `build-pass` directives have been migrated. To allow migration of the check-pass tests, this PR also adds support for revision names beginning with `cpass`. No incremental tests were using `run-pass`.

---

Several of the migrated `build-pass` tests have a FIXME indicating that they could potentially be migrated to `check-pass` instead. This PR does not perform that migration.

In the future, I intend to do more cleanup of how compiletest handles pass/fail expectations, but I didn't want to cram too much into one PR.

r? jieyouxu
2026-04-22 01:53:39 -04:00
Nicholas Nethercote f0ebd66eaa Remove unused tcx params.
They are unused because of the previous commit.
2026-04-22 13:54:57 +10:00
Nicholas Nethercote be52e75d69 Simplify one MetaBlob impl.
It's currently an impl for `(CrateMetadataRef, TyCtxt)`, but (a) the
`TyCtxt` is not used, and (b) the `CrateMetadataRef` can be simplified
to a `CrateMetadata` because `CStore` access isn't required. This
require changing `blob` to take `&self`, which is no big deal, and it
simplifies many `get` calls.
2026-04-22 13:25:15 +10:00
Nicholas Nethercote 2f864a9d03 Split Metadata trait into MetaBlob and MetaDecoder.
`Metadata` has two methods, `blob` and `decoder`, which are not used
together. Splitting the trait in two will allow some cleanups in
subsequent commits.
2026-04-22 13:13:25 +10:00
bors 1bfcb284f7 Auto merge of #155392 - WaffleLapkin:alias-termmm, r=BoxyUwU
`AliasTerm` refactor

follow up to https://github.com/rust-lang/rust/pull/154758
tracking issue: https://github.com/rust-lang/rust/issues/154941
2026-04-22 02:57:46 +00:00
Zalathar 87ec57f3a1 Forbid *-pass directives in incremental tests
Incremental tests that would have used the `check-pass`, `build-pass`, or
`run-pass` directives should instead use a revision name starting with
`cpass`/`bpass`/`rpass` as appropriate.
2026-04-22 12:34:14 +10:00
Zalathar edbb86264d Add support for cpass incremental revisions 2026-04-22 12:34:14 +10:00
Zalathar 0ea8958c02 Migrate bfail/build-pass tests to bpass (2/2)
This is the subset of incremental tests that have a FIXME to consider migrating
to check-pass instead.

That migration is beyond the scope of this PR, but might be attempted later.
2026-04-22 12:28:25 +10:00
Zalathar 793c646b7b Migrate bfail/build-pass tests to bpass (1/2)
This is the subset of incremental tests that should continue to use `bpass`
even after `cpass` is supported, because they (presumably) involve codegen.
2026-04-22 12:28:25 +10:00
cijiugechu b90687377c Add constness & asyncness 2026-04-22 10:22:14 +08:00
Nicholas Nethercote cb3df68743 Streamline CrateMetadataRef construction in provide_one!.
`cstore.get_crate_data()` creates a `CrateMetadataRef`, which is exactly
what we need. The current code is very confused and does several
unnecessary things: mapping the `FreezeReadGuard` and calling
`CStore::from_tcx` a second time to construct a second
`CrateMetadataRef`.

This is a small perf win.
2026-04-22 12:21:04 +10:00
bors f9988fefd3 Auto merge of #155611 - JonathanBrouwer:rollup-hUV99y1, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#155546 (Improve E0308 error message for `impl Trait` return mismatches)
 - rust-lang/rust#152834 (Fix incorrect `let` to `const` suggestion for pattern bindings)
 - rust-lang/rust#155425 (Remove duplicated `Flags` methods.)
 - rust-lang/rust#155547 (Use per-parent disambiguators everywhere)
 - rust-lang/rust#155590 (Remove AttributeLintKind variants - part 5)
2026-04-21 23:34:47 +00:00
Daniel Scherzer 05485026ad tests/ui/macros: add annotations for reference rules 2026-04-21 15:46:04 -07:00
Folkert de Vries 45f98b9aa7 va_arg: remove unused argument 2026-04-22 00:07:01 +02:00
Folkert de Vries 0169aaea31 va_arg: fix potential misaligned load 2026-04-22 00:06:54 +02:00
mejrs 70cf3f4fda Put #[diagnostic::on_move] on File 2026-04-21 23:42:33 +02:00
Oli Scherer fe2e5a9cfa Remove a bunch of unnecessary explicit lifetimes from the ast validator 2026-04-21 23:21:23 +02:00
Oli Scherer 3070ce9d1b Immediately feed visibility on DefId creation 2026-04-21 22:45:34 +02:00
Oli Scherer af03b49b25 Handle MacCall items directly in the def collector
instead of entangling it with the brg logic
2026-04-21 22:45:03 +02:00
Oli Scherer 209a2a6e33 delegation macros are never handled in the def collector 2026-04-21 22:45:03 +02:00
Oli Scherer 797e68f240 Move variant ctor creation into the brg 2026-04-21 22:45:03 +02:00
Oli Scherer af3e34bf65 Stop creating ctor def ids for unions and move the ctor def id creation into the brg 2026-04-21 22:45:03 +02:00
Folkert de Vries 6ca836bc5b c-variadic: tweak std docs 2026-04-21 22:44:26 +02:00
bors 9ec5d5f32e Auto merge of #155604 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

9 commits in 7ecf0285ebb408d596e4a8ac76a0980d8edb7005..06ac0e7c05770a8c7bbf67bdd12fa1a1eefdc8ae
2026-04-18 15:34:11 +0000 to 2026-04-21 15:33:56 +0000
- test(git): add regression test for full-hash GitHub fast path (rust-lang/cargo#16919)
- fix(help): add `.1` extension to man page temp file (rust-lang/cargo#16917)
- Fix flaky test: sparse_blocking_count (rust-lang/cargo#16916)
- Fix flaky test compile_offline_while_transitive_dep_not_cached (rust-lang/cargo#16915)
- Fix test fetch_all_platform_dependencies_when_no_target_is_given (rust-lang/cargo#16914)
- chore(ci): Use `actions/deploy-pages` for Cargo Contributor Guide deployment (rust-lang/cargo#16876)
- Convert GitHub fast path to use http_async (rust-lang/cargo#16912)
- refactor(network): convert .crate downloads to use http_async (rust-lang/cargo#16902)
- fix(tests): flaky test local_poll_adapter deferred_success (rust-lang/cargo#16909)

r? ghost
2026-04-21 20:04:46 +00:00
cyrgani d54b62fdcd rename and move deriving/issue-*.rs 2026-04-21 19:45:01 +00:00
cyrgani 3a6c164d2e cleanup deriving/issue-*.rs 2026-04-21 19:31:26 +00:00
Jonathan Brouwer 79e2ff7d72 Rollup merge of #155590 - GuillaumeGomez:rm-attributelintkind, r=JonathanBrouwer
Remove AttributeLintKind variants - part 5

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

r? @JonathanBrouwer
2026-04-21 20:42:53 +02:00
Jonathan Brouwer aa3335484f Rollup merge of #155547 - aerooneqq:better-disambiguators, r=oli-obk
Use per-parent disambiguators everywhere

This PR addressing the following concerns about per-parent disambiguators (rust-lang/rust#153955):

- DisambiguatorState is removed, PerParentDisambiguatorState is now used everywhere,
- Steals were removed from every per-parent disambiguator in resolver,
- It adds `parent` field in `PerParentDisambiguatorState` in `#[cfg(debug_assertions)]` for asserting that per-parent disambiguator corresponds to the same `LocalDefId` which is passed into `create_def`,
- ~Removes `Disambiguator` trait replacing it with `Disambiguator` enum, with this change we no longer expose `next` method (as trait should be public otherwise the warning will be emitted). It may affect perf in a negative way though.~

~Those changes should not fix perf issues that were [reported](https://github.com/rust-lang/rust/pull/153955#issuecomment-4269223191), perf run that was attempted [before](https://github.com/rust-lang/rust/pull/153955#issuecomment-4214516698) showed much better results. Performance can be probably fixed by removing per-parent disambiguators replacing them with a single one as it was before, then it will be passed to AST -> HIR lowering and modified. For delayed owners we can store ~followup disambiguators as it was in the beginning of the rust-lang/rust#153955~ per-parent disambiguators. This solution should save achievements from rust-lang/rust#153955 (removed `DefPathData` variants).
However, I would prefer to keep per-parent disambiguators as it seems a better architectural solution for me.~

r? @petrochenkov
cc @oli-obk
2026-04-21 20:42:52 +02:00
Jonathan Brouwer 63b6bd933e Rollup merge of #155425 - nnethercote:rm-dup-Flags-methods, r=nikomatsakis
Remove duplicated `Flags` methods.

The `Flags` trait has two methods: `flags` and `outer_exclusive_binder`. Multiple types impl this trait and then also have duplicate inherent methods with the same names; these are all marked with "Think about removing this" comments. This is left over from things being moved into `rustc_type_ir`.

This commit removes those inherent methods. This requires adding `use Flags` to a number of files.

r? @lcnr
2026-04-21 20:42:51 +02:00
Jonathan Brouwer 65fcd87abd Rollup merge of #152834 - lapla-cogito:issue_152831, r=jackh726
Fix incorrect `let` to `const` suggestion for pattern bindings

When a variable from a pattern binding was referenced inside a `const {}` block, the compiler incorrectly suggested replacing `let` with `const`. This was reported in rust-lang/rust#152831 for `if let`, but also applies to `while let` and `let ... else`.
2026-04-21 20:42:51 +02:00
Jonathan Brouwer 5abe5ea630 Rollup merge of #155546 - Unique-Usman:ua/impl_traits, r=estebank
Improve E0308 error message for `impl Trait` return mismatches

When a function returns `impl Trait`, all branches must return the same concrete type. Previously, the compiler showed:

    expected `First` because of return type

This was misleading, as it suggested the return type was `First`, rather than any single type implementing the trait.

Update the diagnostic to:

    expected a single type implementing `Value` because of return type

Also highlight the first return expression to make it clearer why subsequent returns do not match.
2026-04-21 20:42:50 +02:00
Omnikar 2863ed640f Add missing dyn keyword to trait_alias page of the Unstable Book 2026-04-21 14:16:54 -04:00
Josh Stone 29ccf67f77 rustc_thread_pool: Make CoreLatch::set use SeqCst instead of AcqRel
Every other modification of this variable uses `SeqCst`, which is
justified in the sleep README. This particular choice of `AcqRel` was
not discussed during its addition in rayon-rs/rayon#746, nor
rayon-rs/rfcs#5, so I suspect was simply an oversight from earlier
development. We probably do want this to participate in the same
sequential consistency.

The only other ordering difference is `CoreLatch::probe`'s load with
`Acquire`, which should be fine because this doesn't need consistency
with the sleep counters.

See also rayon-rs/rayon#1297. As I commented there, I think in practice
this would be quite rare to cause any problems, but it *could* be a
source of non-deterministic bugs on targets with weak memory ordering.
2026-04-21 10:41:56 -07:00
Guillaume Gomez 80777dd748 Reorder emails of Guillaume Gomez so it appears as its primary email and not the old one 2026-04-21 19:28:54 +02:00
Guillaume Gomez 940d0f8245 Remove AttributeLintKind::UnknownCrateTypesSuggestion variant 2026-04-21 19:28:53 +02:00