Commit graph

318186 commits

Author SHA1 Message Date
bors
a423f68a0d Auto merge of #152533 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? @Manishearth 

1 week late, due to vacation and some technical issues.
2026-02-13 18:09:00 +00:00
bors
d7daac06d8 Auto merge of #152562 - Zalathar:rollup-tQDKhYQ, r=Zalathar
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#150551 (Compute localized outlives constraints lazily)
 - rust-lang/rust#150988 (Improve code suggestion for incorrect macro_rules! usage)
 - rust-lang/rust#152422 (Change query proc macro to be more rust-analyzer friendly)
 - rust-lang/rust#152496 (Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto)
 - rust-lang/rust#152514 (Collect active query jobs into struct `QueryJobMap`)
 - rust-lang/rust#152520 (Don't use `DepContext` in `rustc_middle::traits::cache`)
 - rust-lang/rust#152528 (Support serializing CodegenContext)
 - rust-lang/rust#152082 (Move tests)
 - rust-lang/rust#152232 (Add must_use for FileTimes)
 - rust-lang/rust#152329 (Simplify parallel! macro)
 - rust-lang/rust#152444 (`-Znext-solver` Prevent committing unfulfilled unsized coercion)
 - rust-lang/rust#152486 (remove redundant backchain attribute in codegen)
 - rust-lang/rust#152519 (Fix feature gating for new `try bikeshed` expressions)
 - rust-lang/rust#152529 (sparc64: enable abi compatibility test)
 - rust-lang/rust#152548 (reject inline const patterns pre-expansion)
 - rust-lang/rust#152550 (Port #[prelude_import] to the attribute parser)
 - rust-lang/rust#152552 (Add 2048-bit HvxVectorPair support to Hexagon SIMD ABI checks)

Failed merges:

 - rust-lang/rust#152515 (Extract `DepKindVTable` constructors to their own module)
2026-02-13 08:37:54 +00:00
Stuart Cook
b9ce1e0369
Rollup merge of #152552 - androm3da:hexagon-hvx-abi-rules, r=madsmtm
Add 2048-bit HvxVectorPair support to Hexagon SIMD ABI checks

Previously, rustc rejected HvxVectorPair types in function signatures because the HEXAGON_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI array only had entries for vectors up to 1024 bits. This caused the ABI checker to emit "unsupported vector type" errors for 2048-bit HvxVectorPair (used in 128-byte HVX mode).

Add 2048 byte entry to allow HvxVectorPair to be passed in extern "C" funcs when the hvx-length128b is enabled.
2026-02-13 15:19:15 +11:00
Stuart Cook
9e0a05b481
Rollup merge of #152550 - Ozzy1423:rustc-attrs, r=JonathanBrouwer
Port #[prelude_import] to the attribute parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

r? @JonathanBrouwer

Didn't change any use-sites of it in the compiler
2026-02-13 15:19:15 +11:00
Stuart Cook
5266800936
Rollup merge of #152548 - dianne:reject-const-block-pat-pre-expansion, r=fmease
reject inline const patterns pre-expansion

Reverts the parser changes from https://github.com/rust-lang/rust/pull/149667

Fixes https://github.com/rust-lang/rust/issues/152499

Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. https://github.com/rust-lang/rust/pull/149667 switched from only rejecting the former to only rejecting the latter.
2026-02-13 15:19:14 +11:00
Stuart Cook
3b0a16738a
Rollup merge of #152529 - folkertdev:sparc64-enable-abi-compat-test, r=RalfJung
sparc64: enable abi compatibility test

fixes https://github.com/rust-lang/rust/issues/115336

We can now remove the exceptions for sparc64 from the abi compatibility tests (since https://github.com/rust-lang/rust/pull/142680).

I was also able to remove a cfg for mips64. The remaining (tested) issues seem to be around how `f64` is handled there.

cc @RalfJung
r? tgross35
2026-02-13 15:19:14 +11:00
Stuart Cook
426921007e
Rollup merge of #152519 - scottmcm:fix-152501, r=fmease
Fix feature gating for new `try bikeshed` expressions

r? fmease
Fixes rust-lang/rust#152501
2026-02-13 15:19:13 +11:00
Stuart Cook
8b036c7b72
Rollup merge of #152486 - fneddy:s390x_simplify_backchain, r=dingxiangfei2009
remove redundant backchain attribute in codegen

llvm will look at both
1. the values of `"target-features"` and
2. the function string attributes.

this patch removes the redundant function string attribute because it is not needed at all. rustc sets the `+backchain` attribute through `target_features_attr(...)`
d34f1f9314/compiler/rustc_codegen_llvm/src/attributes.rs (L590)
d34f1f9314/compiler/rustc_codegen_llvm/src/attributes.rs (L326-L337)
2026-02-13 15:19:13 +11:00
Stuart Cook
0c0af5c6a8
Rollup merge of #152444 - ShoyuVanilla:unsized-recursion-limit, r=lcnr
`-Znext-solver` Prevent committing unfulfilled unsized coercion

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/266

r? lcnr
2026-02-13 15:19:12 +11:00
Stuart Cook
09720ec3d0
Rollup merge of #152329 - Zoxc:simple-parallel-macro, r=nnethercote
Simplify parallel! macro

This replaces the `parallel!` macro with a `par_fns` function.
2026-02-13 15:19:12 +11:00
Stuart Cook
eaa6766793
Rollup merge of #152232 - chenyukang:add-must-use-for-filetimes, r=Mark-Simulacrum
Add must_use for FileTimes

Fixes rust-lang/rust#152231
2026-02-13 15:19:11 +11:00
Stuart Cook
492eb8361e
Rollup merge of #152082 - Delta17920:move-tests, r=chenyukang,Kivooeo
Move tests

moved few tests

r? @Kivooeo
2026-02-13 15:19:11 +11:00
Stuart Cook
1378e9efeb
Rollup merge of #152528 - bjorn3:lto_refactors11, r=petrochenkov
Support serializing CodegenContext

Follow up to https://github.com/rust-lang/rust/pull/149209
Part of https://github.com/rust-lang/compiler-team/issues/908
2026-02-13 15:19:10 +11:00
Stuart Cook
caca3d4f1a
Rollup merge of #152520 - Zalathar:traits-cache, r=dingxiangfei2009
Don't use `DepContext` in `rustc_middle::traits::cache`

- A nice little simplification unlocked by https://github.com/rust-lang/rust/pull/152199.

---

This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
2026-02-13 15:19:10 +11:00
Stuart Cook
504bc6699c
Rollup merge of #152514 - Zalathar:job-map, r=nnethercote
Collect active query jobs into struct `QueryJobMap`

This PR encapsulates the existing `QueryMap` type alias into a proper struct named `QueryJobMap`, which is used by code that wants to inspect the full set of currently-active query jobs.

Wrapping the query job map in a struct makes it easier to see how other code interacts with the map, and also lets us change some free functions for map lookup into methods.

We also do a renaming pass to consistently refer to the query job map as `job_map`, or as `job_map_out` in the places where it's a mutable out-parameter.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
2026-02-13 15:19:09 +11:00
Stuart Cook
15e349d084
Rollup merge of #152496 - ZuseZ4:fix-autodiff-dbg-build, r=bjorn3
Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto

fixes: https://github.com/rust-lang/rust/issues/152470

r? @bjorn3
2026-02-13 15:19:09 +11:00
Stuart Cook
bc3b9de404
Rollup merge of #152422 - Zoxc:query-macro-tweaks, r=Zalathar
Change query proc macro to be more rust-analyzer friendly

This changes the query proc macro to be more rust-analyzer friendly.

- Types in the macro now have a proper span
- Some functions have their span hidden so they don't show up when hovering over the query name
- Added a hint on the provider field on how to find providers. That is shown when hovering over the query name
- Linked query name to the provider field on all queries, not just ones with caching
- Added tooltip for the query modifiers by linking to the new types in `rustc_middle:::query::modifiers`
2026-02-13 15:19:08 +11:00
Stuart Cook
6c2700b256
Rollup merge of #150988 - chenyukang:yukang-fix-150899-macro-rules, r=petrochenkov
Improve code suggestion for incorrect macro_rules! usage

Fixes rust-lang/rust#150899
2026-02-13 15:19:08 +11:00
Stuart Cook
5df4f59fe3
Rollup merge of #150551 - lqd:lazy-polonius, r=jackh726
Compute localized outlives constraints lazily

This PR rewrites the loan liveness algorithm to compute localized constraints lazily during traversal, to avoid the sometimes costly conversion and indexing happening in the current eager algorithm (or for now as well, the need to reshape the liveness data to better list regions live at a given point).

It thus greatly reduces the current alpha overhead, although it wasn't entirely removed of course (we're obviously doing more work to improve precision): the worst offending benchmark has a +5-6% wall-time regression — but icounts are worse looking (+13%) rn.

Best reviewed per-commit, as steps are in sequence to simplify the process or unify some things.

r? @jackh726
2026-02-13 15:19:07 +11:00
Scott McMurray
6afebcc4dd Fix feature gating for new try bikeshed expressions 2026-02-12 12:17:49 -08:00
Brian Cain
eb1e411629 Add 2048-bit HvxVectorPair support to Hexagon SIMD ABI checks
Previously, rustc rejected HvxVectorPair types in function signatures
because the HEXAGON_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI array
only had entries for vectors up to 1024 bits. This caused the ABI checker
to emit "unsupported vector type" errors for 2048-bit HvxVectorPair
(used in 128-byte HVX mode).

Add 2048 byte entry to allow HvxVectorPair to be passed
in extern "C" funcs when the hvx-length128b is enabled.
2026-02-12 13:02:47 -06:00
Rémy Rakic
285e1be7b4 reduce duplication when finding a successor 2026-02-12 18:29:38 +00:00
Rémy Rakic
880d73396f merge remaining contexts
now that we need to hold the graph for MIR dumping, and the associated
data to traverse it, there is no difference between the main context and
diagnostics context, so we merge them.
2026-02-12 18:29:38 +00:00
Rémy Rakic
1b63325435 adapt polonius MIR dump to lazy graph traversal 2026-02-12 18:29:38 +00:00
Rémy Rakic
7de450ad52 introduce graph traversal abstraction and visitor
we may need to traverse the lazy graph multiple times:
- to record loan liveness
- to dump the localized outlives constraint in the polonius MIR dump

to do that we extract the previous loan liveness code into an abstract
traversal + visitor handling the liveness-specific parts, while the MIR
dump will be able to record constraints in its own visitor.
2026-02-12 18:29:38 +00:00
Rémy Rakic
f4abd15bc5 remove unneeded liveness context
now that the analysis is only using the regular liveness shape, we don't
need to store it transposed, and thus don't need the container where it
was stored: the liveness context would be alone in the polonius context.

we thus remove the latter, and rename the former.
2026-02-12 18:29:38 +00:00
Rémy Rakic
5d151083fc optimization: do nothing if there are no loans 2026-02-12 18:29:38 +00:00
Rémy Rakic
6dcf65a1cb optimization: no need to convert liveness data shape anymore 2026-02-12 18:29:38 +00:00
Rémy Rakic
279d55c30a remove eager constraint conversion 2026-02-12 18:29:38 +00:00
Rémy Rakic
0941151f30 introduce lazy traversal for the polonius constraint graph 2026-02-12 18:29:37 +00:00
Oscar Bray
dd8a98a9bc Fix pretty print tests with #[prelude_import] 2026-02-12 17:43:58 +00:00
Oscar Bray
8526aa5361 Port #[prelude_import] to the attribute parser 2026-02-12 17:43:04 +00:00
bors
47611e1604 Auto merge of #152538 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

8 commits in 0c9e687d237ff04b53ccb67b4ce63e9483789e88..ce69df6f72a3b6a2b5c722ba68ddef255344b31c
2026-02-11 05:58:30 +0000 to 2026-02-12 12:39:45 +0000
- fix: apply `host.runner` only when `host-config` enabled (rust-lang/cargo#16631)
- fix(cli): Improve bad manifest error  (rust-lang/cargo#16630)
- fix: Adjust casing of error message (rust-lang/cargo#16625)
- Enable triagebot new `[view-all-comments-link]` feature (rust-lang/cargo#16629)
- test(help): snapshot cargo help tests (rust-lang/cargo#16626)
- Suggest a `workspace.members` entry even from outside the workspace root (rust-lang/cargo#16616)
- Reorganize build unit directory layout for new build-dir layout (rust-lang/cargo#16542)
- Make the error messaging for `cargo install` aware of `build.build-dir` (rust-lang/cargo#16623)
2026-02-12 17:30:25 +00:00
dianne
60f802fe11 reject inline const patterns pre-expansion 2026-02-12 08:26:03 -08:00
Shoyu Vanilla
891acbd787 -Znext-solver Prevent committing unfulfilled unsized coercion 2026-02-13 00:57:01 +09:00
Philipp Krones
eaad11cc2c
cg_gcc: remove Clippy expect attribute 2026-02-12 16:55:36 +01:00
Zalathar
b9b28ba1b5 Collect active query jobs into struct QueryJobMap 2026-02-13 01:18:24 +11:00
Weihang Lo
a0eb38a4d3
Update cargo submodule 2026-02-12 22:16:41 +08:00
Philipp Krones
0e2af75bfd
Merge commit 'a62c6af536' into clippy-subtree-update 2026-02-12 14:50:58 +01:00
bors
bb8b30a5fc Auto merge of #148537 - oli-obk:push-yxuttqrqqyvu, r=dianqk
Start using pattern types in libcore (NonZero and friends)

part of rust-lang/rust#136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
2026-02-12 13:23:22 +00:00
bjorn3
2c44bb13c6 Support serializing CodegenContext 2026-02-12 12:44:15 +00:00
bjorn3
506ed6dcb7 Remove SelfProfilerRef from CodegenContext
It can't be serialized to a file.
2026-02-12 12:44:14 +00:00
Folkert de Vries
d8ed639e30
sparc64: enable abi compatibility test 2026-02-12 12:42:39 +01:00
John Kåre Alsaker
8cc4b936a4 Change query proc macro to be more rust-analyzer friendly 2026-02-12 12:39:51 +01:00
John Kåre Alsaker
8c5ce26e43 Replace parallel! macro with par_fns function and rename join to par_join 2026-02-12 12:20:18 +01:00
Eddy (Eduard) Stefes
c6f57becfc remove redundant backchain attribute in codegen
llvm will look at both
1. the values of "target-features" and
2. the function string attributes.

this removes the redundant function string attribute because it is not needed at all.
rustc sets the `+backchain` attribute through `target_features_attr(...)`
2026-02-12 09:58:25 +01:00
yukang
caf7cdf558 Improve code suggestion for incorrect macro_rules! usage 2026-02-12 15:30:41 +08:00
Zalathar
576901f3a4 Don't use DepContext in rustc_middle::traits::cache
This code is now in `rustc_middle`, and doesn't need any non-trivial methods,
so it can just use `TyCtxt` directly instead.
2026-02-12 18:30:16 +11:00
bors
7ad4e69ad5 Auto merge of #152517 - jhpratt:rollup-fGRcId6, r=jhpratt
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#142415 (Add note when inherent impl for a alias type defined outside of the crate)
 - rust-lang/rust#142680 (Fix passing/returning structs with the 64-bit SPARC ABI)
 - rust-lang/rust#150768 (Don't compute FnAbi for LLVM intrinsics in backends)
 - rust-lang/rust#151152 (Add FCW for derive helper attributes that will conflict with built-in attributes)
 - rust-lang/rust#151814 (layout: handle rigid aliases without params)
 - rust-lang/rust#151863 (Borrowck: simplify diagnostics for placeholders)
 - rust-lang/rust#152159 (Add note for `?Sized` params in int-ptr casts diag)
 - rust-lang/rust#152434 (Clarify names of `QueryVTable` functions for "executing" a query)
 - rust-lang/rust#152478 (Remove tm_factory field from CodegenContext)
 - rust-lang/rust#152498 (Partially revert "resolve: Update `NameBindingData::vis` in place")
 - rust-lang/rust#152316 (fix: add continue)
 - rust-lang/rust#152394 (Correctly check if a macro call is actually a macro call in rustdoc highlighter)
 - rust-lang/rust#152425 (Port #![test_runner] to the attribute parser)
 - rust-lang/rust#152481 (Use cg_ssa's produce_final_output_artifacts in cg_clif)
 - rust-lang/rust#152485 (fix issue#152482)
 - rust-lang/rust#152495 (Clean up some subdiagnostics)
 - rust-lang/rust#152502 (Implement `BinaryHeap::from_raw_vec`)
2026-02-12 06:57:59 +00:00
Jacob Pratt
faac3c579f
Rollup merge of #152502 - Dan54:heap-from-raw-vec, r=scottmcm
Implement `BinaryHeap::from_raw_vec`

Implements rust-lang/rust#152500.

Adds a `BinaryHeap::from_raw_vec` function, which constructs a `BinaryHeap` without performing a heapify, for data that is already a max-heap.
2026-02-12 00:41:12 -05:00