Commit graph

318454 commits

Author SHA1 Message Date
Vadim Petrochenkov
b541f1b198 resolve: Disable an assert that no longer holds 2026-02-16 16:07:08 +03:00
bors
fef627b1eb Auto merge of #152636 - nnethercote:big-cleanups, r=Zalathar
Big query system cleanups

Recent PRs have moved a lot of code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, where this code now has access to `TyCtxt`, e.g. rust-lang/rust#152419, rust-lang/rust#152516. As a result, a lot of abstraction and indirection that existed to work around this limitation is no longer necessary. This PR removes a lot of it.

r? @Zalathar
2026-02-16 04:20:25 +00:00
bors
139651428d Auto merge of #152452 - ShE3py:overruled-lint, r=BoxyUwU
feat: show what lint was overruled

We can't `#[allow]` a whole lint group if any of its members is forbidden, but the offending member is not currently shown if it was forbidden from the command line.

Before/after:
```diff
 $ rustc -F dead_code - <<< '#![allow(unused)]'
 error[E0453]: allow(unused) incompatible with previous forbid
  --> <anon>:1:10
   |
 1 | #![allow(unused)]
   |          ^^^^^^ overruled by previous forbid
   |
-  = note: `forbid` lint level was set on command line
+  = note: `forbid` lint level was set on command line (`-F dead_code`)
 
 error: aborting due to 1 previous error
```

@rustbot label +A-diagnostics +A-lints +D-terse
2026-02-15 20:05:05 +00:00
bors
873b4beb0c Auto merge of #152671 - JonathanBrouwer:rollup-4Ov19Nw, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#152566 (Remove code for ThinLTO from cg_gcc)
 - rust-lang/rust#152278 (Fix const normalization for generic const items with trait assoc consts)
 - rust-lang/rust#152604 (Relocate some tests)
 - rust-lang/rust#152625 (Provide all lint group names to Clippy)
2026-02-15 16:52:45 +00:00
Jonathan Brouwer
ee17e8cb7c
Rollup merge of #152625 - Alexendoo:lint-group-names, r=Kivooeo
Provide all lint group names to Clippy

Unblocks https://github.com/rust-lang/rust-clippy/pull/14689
2026-02-15 16:37:38 +01:00
Jonathan Brouwer
c5a12fbd0d
Rollup merge of #152604 - reddevilmidzy:refactor, r=Zalathar
Relocate some tests

`dynamically-sized-types` -> `dst`
`underscore-imports` -> `imports/underscore-imports`
`btreemap`, `hashmap` -> `collections/btreemap`, `collections/hashmap`
`higher-ranked-trait-bounds` -> `higher-ranked/trait-bounds`
`meta` -> `compiletest-self-test`, `bootstrap`

After the review, I'll squash.
2026-02-15 16:37:37 +01:00
Jonathan Brouwer
8b3ef9e0c7
Rollup merge of #152278 - lapla-cogito:type_const_nested, r=BoxyUwU
Fix const normalization for generic const items with trait assoc consts

In `try_fold_free_or_assoc`, the check for whether the normalization result needs further normalization only considered types, not constants. This caused generic const items marked with `#[type_const]` that reference trait associated consts to only partially normalize—the outer const would be expanded, but the inner associated const would remain unevaluated, resulting in an ICE in borrowck.

close rust-lang/rust#151647

r? BoxyUwU
(Based on git blame)
2026-02-15 16:37:37 +01:00
Jonathan Brouwer
4a4ea14148
Rollup merge of #152566 - bjorn3:cg_gcc_no_thin_lto, r=antoyo
Remove code for ThinLTO from cg_gcc

It was just a dummy implementation to workarround the fact that thin local lto is the default in rustc. By adding a thin_lto_supported thin local lto can be automatically disabled for cg_gcc, removing the need for this dummy implementation. This makes improvements to the LTO handling on the cg_ssa side a lot easier.

cc [#rustc-codegen-gcc > thin LTO implementation](https://rust-lang.zulipchat.com/#narrow/channel/386786-rustc-codegen-gcc/topic/thin.20LTO.20implementation/with/573625132)
This should make the work on https://github.com/rust-lang/compiler-team/issues/908 easier.

r? rust-lang/wg-gcc-backend
2026-02-15 16:37:36 +01:00
Lieselotte
d12923346c
feat: show what lint was overruled 2026-02-15 15:40:13 +01:00
bors
2219766af6 Auto merge of #152605 - scottmcm:box-drop-alignment, r=Mark-Simulacrum
Pass alignments through the shim as `Alignment` (not `usize`)

We're using `Layout` on both sides, so might as well skip the transmutes back and forth to `usize`.

The mir-opt test shows that doing so allows simplifying the boxed-slice drop slightly, for example.
2026-02-15 13:38:45 +00:00
lapla
88f0ac34dc
Fix const normalization for generic const items with trait assoc consts 2026-02-15 22:05:27 +09:00
bjorn3
fa753a46c1 Remove code for ThinLTO from cg_gcc
It was just a dummy implementation to workarround the fact that thin
local lto is the default in rustc. By adding a thin_lto_supported thin
local lto can be automatically disabled for cg_gcc, removing the need
for this dummy implementation. This makes improvements to the LTO
handling on the cg_ssa side a lot easier.
2026-02-15 10:05:48 +00:00
bors
4c37f6d78c Auto merge of #152375 - Zoxc:rayon-scope-loops, r=jieyouxu,lqd
Use `scope` for `par_slice` instead of `join`

This uses `scope` instead of nested `join`s in `par_slice` so that each group of items are independent and do not end up blocking on another.
2026-02-15 09:55:40 +00:00
bors
ce0bf0b22b Auto merge of #152639 - jhpratt:rollup-sIUYGho, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#150424 (diagnostics: add note when param-env shadows global impl)
 - rust-lang/rust#152132 (implement `carryless_mul`)
 - rust-lang/rust#152508 (Improve write! and writeln! error when called without destination)
 - rust-lang/rust#152534 (Test(lib/win/net): Skip UDS tests when under Win7)
 - rust-lang/rust#152578 (ci: Lock cross toolchain version and update docs)
 - rust-lang/rust#152188 (Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates)
 - rust-lang/rust#152402 (Add regression test for rust-lang/rust#141738)
 - rust-lang/rust#152472 (unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block)
 - rust-lang/rust#152610 (Exchange js_lint message between bless and non-bless)
2026-02-15 06:20:35 +00:00
reddevilmidzy
c92f384eb1 Move meta tests to compiletest-self-test, bootstrap dir 2026-02-15 04:43:02 +00:00
reddevilmidzy
86f1affe5a Move higher-ranked-trait-bounds tests into higher-ranked subdir 2026-02-15 04:39:21 +00:00
reddevilmidzy
863caf8b6b Move btreemap, hashmap tests into collections subdir 2026-02-15 04:39:13 +00:00
reddevilmidzy
1612988310 Move underscore-imports tests into imports subdir 2026-02-15 04:38:55 +00:00
reddevilmidzy
abca0d5f74 Move dynamically-sized-types tests into dst dir 2026-02-15 04:38:12 +00:00
Jacob Pratt
12755aa52c
Rollup merge of #152610 - Shunpoco:fix-js-lint-bless-message, r=clubby789
Exchange js_lint message between bless and non-bless

The message `applying suggestions` should be emitted when bless is enabled.
2026-02-14 23:17:41 -05:00
Jacob Pratt
5d2a033b85
Rollup merge of #152472 - lizan:wasm, r=Mark-Simulacrum
unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block

This fix rust-std compile error on wasm32-unknown-unknown with panic=unwind because of `#![deny(unsafe_op_in_unsafe_fn)]`
2026-02-14 23:17:41 -05:00
Jacob Pratt
9369cfff04
Rollup merge of #152402 - AprilNEA:test/issue-141738-struct-ctor-array-len, r=BoxyUwU
Add regression test for #141738

Closes rust-lang/rust#141738

- Add a regression test for rust-lang/rust#141738
- Using a struct constructor (`DefKind::Ctor(Struct, Const)`) as an array repeat count with `#![feature(min_generic_const_args)]` used to ICE in const alias normalization
- Fixed by rust-lang/rust#150704, which added const constructor support for mGCA. This test covers the **error path** (struct ctor where `usize` is expected), which was not covered by the tests in rust-lang/rust#150704
2026-02-14 23:17:40 -05:00
Jacob Pratt
ef776c603c
Rollup merge of #152188 - cuviper:placeholder-stdarch, r=Mark-Simulacrum
Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates

Our tool `replace-version-placeholder` uses the `tidy` file walker and its
directory filter, but that skips `library/stdarch` which we do need for public
stability markers. This PR adds a local filter function that explicitly allows
that path.

The commit for 1.94 `stdarch` updates is coming from beta rust-lang/rust#152187.
2026-02-14 23:17:40 -05:00
Jacob Pratt
9f0b29be99
Rollup merge of #152578 - heiher:ci-crosstool, r=Mark-Simulacrum
ci: Lock cross toolchain version and update docs

This PR locks the cross-toolchain component version to avoid unexpected changes when bumping crosstool-ng, and updates the toolchain configuration in the docs to match the actual setup.

try-job: dist-arm-linux-musl
try-job: dist-loongarch64-linux
try-job: dist-loongarch64-musl
try-job: dist-powerpc64-linux-musl
try-job: dist-powerpc64le-linux-gnu
try-job: dist-powerpc64le-linux-musl
2026-02-14 23:17:39 -05:00
Jacob Pratt
3ce7fb6607
Rollup merge of #152534 - PaulDance:patches/remove-win7-uds, r=Mark-Simulacrum
Test(lib/win/net): Skip UDS tests when under Win7

Unix Domain Socket support has only been added to Windows since Windows 10 Insider Preview Build 17063. Thus, it has no chance of ever being supported under Windows 7, making current tests fail. This therefore adds the necessary in order to make the tests dynamically skip when run under Windows 7, 8, and early 10, as it does not trigger linker errors.

cc rust-lang/rust#150487 @roblabla

@rustbot label T-libs A-io O-windows-7
2026-02-14 23:17:32 -05:00
Jacob Pratt
8075b89aa6
Rollup merge of #152508 - arferreira:improve-write-macro-diagnostic, r=Mark-Simulacrum
Improve write! and writeln! error when called without destination

Fixes rust-lang/rust#152493

Adds catch-all arms to `write!` and `writeln!` macros so that calling them without a destination (e.g., `write!("S")` instead of `write!(f, "S")`) gives a clear error instead of the cryptic "unexpected end of macro invocation" pointing at macro internals.

r? @estebank
2026-02-14 23:17:31 -05:00
Jacob Pratt
f065c9dab1
Rollup merge of #152132 - folkertdev:carryless-mul, r=Mark-Simulacrum
implement `carryless_mul`

tracking issue: https://github.com/rust-lang/rust/issues/152080
ACP: https://github.com/rust-lang/libs-team/issues/738

This defers to LLVM's `llvm.clmul` when available, and otherwise falls back to a method from the `polyval` crate ([link](https://github.com/RustCrypto/universal-hashes/blob/master/polyval/src/field_element/soft/soft64.rs)).

Some things are missing, which I think we can defer:

- the ACP has some discussion about additional methods, but I'm not sure exactly what is wanted or how to implement it efficiently
- the SIMD intrinsic is not yet `const` (I think I ran into a bootstrapping issue). That is fine for now, I think in `stdarch` we can't really use this intrinsic at the moment, we'd only want the scalar version to replace some riscv intrinsics.
- the SIMD intrinsic is not implemented for the gcc and cranelift backends. That should be reasonably straightforward once we have a const eval implementation though.
2026-02-14 23:17:31 -05:00
Jacob Pratt
79adcd1375
Rollup merge of #150424 - xonx4l:suggest_param_env_shadowing, r=lcnr
diagnostics: add note when param-env shadows global impl

 This PR adds a diagnostics note when param-env shadows global impl as discussed in https://github.com/rust-lang/rust/issues/149910

It adds a note explaining that the definition is hidden by the generic bound.

r?lcnr
2026-02-14 23:17:30 -05:00
bors
75b9d89c68 Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr
Shallow resolve ty and const vars to their root vars

Continuation of https://github.com/rust-lang/rust/pull/147193
2026-02-15 03:04:28 +00:00
Nicholas Nethercote
fcea886c1a Break up DepsType.
By moving most of it into `DepKind`, and changing two methods into free
functions.
2026-02-15 13:07:41 +11:00
Nicholas Nethercote
7c877d994b Remove DepContext.
It's no longer needed now that we can access `TyCtxt` directly.
2026-02-15 13:07:40 +11:00
Nicholas Nethercote
414be2e6ff Remove Deps.
It's no longer needed.
2026-02-15 13:07:39 +11:00
Nicholas Nethercote
1d83208683 De-genericize the dep graph.
By removing the generic `D` parameter from `DepGraph`, `DepGraphData`,
`CurrentDepGraph`, `SerializedDepGraph`, `SerializedNodeHeader`, and
`EncoderState`.
2026-02-15 13:07:37 +11:00
Nicholas Nethercote
32e6a1a0ab Remove QueryContext.
`rustc_query_system` has been reduced so much that it's no longer
needed. This avoids a lot of indirection and abstraction.
2026-02-15 13:07:35 +11:00
Alex Macleod
54875f6835 Provide all lint group names to Clippy
Unblocks https://github.com/rust-lang/rust-clippy/pull/14689
2026-02-15 00:32:37 +00:00
bors
7bee525095 Auto merge of #152632 - JonathanBrouwer:rollup-hVWecYA, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152622 (Update GCC subtree)
 - rust-lang/rust#145024 (Optimize indexing slices and strs with inclusive ranges)
 - rust-lang/rust#151365 (UnsafePinned: implement opsem effects of UnsafeUnpin)
 - rust-lang/rust#152381 (Do not require `'static` for obtaining reflection information.)
 - rust-lang/rust#143575 (Remove named lifetimes in some `PartialOrd` & `PartialEq` `impl`s)
 - rust-lang/rust#152404 (tests: adapt align-offset.rs for InstCombine improvements in LLVM 23)
 - rust-lang/rust#152582 (rustc_query_impl: Use `ControlFlow` in `visit_waiters` instead of nested options)
2026-02-14 23:32:04 +00:00
xonx
1be41648d4 move and add comment 2026-02-14 21:32:57 +00:00
Jonathan Brouwer
7c36d152b4
Rollup merge of #152582 - petrochenkov:waitvisit, r=TaKO8Ki
rustc_query_impl: Use `ControlFlow` in `visit_waiters` instead of nested options

Noticed when reviewing https://github.com/rust-lang/rust/pull/152229.
2026-02-14 22:11:55 +01:00
Jonathan Brouwer
e6ca590153
Rollup merge of #152404 - durin42:llvm-23-instcombine-shrink-constant, r=Mark-Simulacrum
tests: adapt align-offset.rs for InstCombine improvements in LLVM 23

Upstream [has improved InstCombine](8d2078332c) so that it can shrink added constants using known zeroes, which caused a little bit of change in this test. As far as I can tell either output is fine, so we just accept both.

@rustbot label: +llvm-main
2026-02-14 22:11:54 +01:00
Jonathan Brouwer
96066cb5b5
Rollup merge of #143575 - GrigorenkoPV:unused_lifetimes, r=Mark-Simulacrum
Remove named lifetimes in some `PartialOrd` & `PartialEq` `impl`s

Makes [the docs](https://doc.rust-lang.org/1.88.0/std/cmp/trait.PartialOrd.html#impl-PartialOrd%3CPathBuf%3E-for-Cow%3C'a,+Path%3E) way easier to look at, gets rid of a few `#[allow(unused_lifetimes)]`, and AFAICT is completely equivalent.
2026-02-14 22:11:54 +01:00
Jonathan Brouwer
16da3ab2ea
Rollup merge of #152381 - oli-obk:non_static_reflection, r=Mark-Simulacrum
Do not require `'static` for obtaining reflection information.

tracking issue rust-lang/rust#142577

This does not affect the stable `TypeId::of`, as that has its own `'static` bound.

But it will allow obtaining `TypeId`s for non-static types via the reflection API. To obtain such a `TypeId` for any type, just use `Type::of::<(T,)>().kind` to extract the first field of a tuple.

This effectively reintroduces rust-lang/rust#41875, which @rust-lang/lang decided against allowing back in 2018 due to lack of sound use cases. We will thus need to have a T-lang meeting specifically about `TypeId` for non-static types before *stabilizing* any part of reflection (in addition to T-lang meetings about reflection in general). I'm adding an explicit point about this to the tracking issue.

cc @scottmcm @joshtriplett @9SonSteroids @SpriteOvO @izagawd @BD103
2026-02-14 22:11:53 +01:00
Jonathan Brouwer
33c2a6eba9
Rollup merge of #151365 - RalfJung:unsafe-unpin-opsem, r=BoxyUwU
UnsafePinned: implement opsem effects of UnsafeUnpin

This implements the next step for https://github.com/rust-lang/rust/issues/125735: actually making `UnsafePinned` have special opsem effects by suppressing the `noalias` *even if* the type is wrapped in an `Unpin` wrapper.

For backwards compatibility we also still keep the `Unpin` hack, i.e. a type must be both `Unpin` and `UnsafeUnpin` to get `noalias`.
2026-02-14 22:11:53 +01:00
Jonathan Brouwer
6d625cc074
Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum
Optimize indexing slices and strs with inclusive ranges

Instead of separately checking for `end == usize::MAX` and `end + 1 > slice.len()`, we can check for `end >= slice.len()`. Also consolidate all the str indexing related panic functions into a single function which reports the correct error depending on the arguments, as the slice indexing code already does.

The downside of all this is that the panic message is slightly less specific when trying to index with `[..=usize::MAX]`: instead of saying "attempted to index str up to maximum usize" it just says "end byte index {end} out of bounds". But this is a rare enough case that I think it is acceptable
2026-02-14 22:11:52 +01:00
Jonathan Brouwer
0318407e30
Rollup merge of #152622 - GuillaumeGomez:subtree-update_cg_gcc_2026-02-14, r=GuillaumeGomez
Update GCC subtree

cc @antoyo
r? ghost
2026-02-14 22:11:52 +01:00
Folkert de Vries
b935f379b4
implement carryless_mul 2026-02-14 21:23:30 +01:00
AprilNEA
8d96e26684
Add regression test for struct ctor used as array repeat count under mGCA
Using a struct constructor (DefKind::Ctor(Struct, Const)) as an array
repeat count with `#![feature(min_generic_const_args)]` used to trigger
an ICE in const alias normalization. Add a regression test to ensure
the compiler produces a proper type error instead of panicking.
2026-02-14 19:44:50 +00:00
bors
a33907a7a5 Auto merge of #152627 - JonathanBrouwer:rollup-wjHXhK0, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#152618 (stdarch subtree update)
 - rust-lang/rust#152001 (mGCA: Validate const literal against expected type)
 - rust-lang/rust#152120 (Don't ICE on layout error in vtable computation)
 - rust-lang/rust#152531 (`proc_macro::bridge`: simplify `ExecutionStrategy` and `DispatcherTrait`)
 - rust-lang/rust#152577 (Port #[rustc_proc_macro_decls] to the new attribute parser.)
 - rust-lang/rust#152570 (Port #[rustc_test_marker] to the attribute parser)
 - rust-lang/rust#152590 (DepGraphQuery: correctly skip adding edges with not-yet-added nodes)
 - rust-lang/rust#152612 (Rename `inline_fluent!` to `msg!`)
2026-02-14 17:56:54 +00:00
Jonathan Brouwer
38cc50b6e4
Rollup merge of #152612 - JonathanBrouwer:rename_to_msg, r=jdonszelmann
Rename `inline_fluent!` to `msg!`

This was the most popular name for the macro as voted in [#t-compiler > Bikeshed the new &#96;inline_fluent!&#96; macro @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Bikeshed.20the.20new.20.60inline_fluent!.60.20macro/near/572751863)
2026-02-14 18:55:38 +01:00
Jonathan Brouwer
3f3c6fda3d
Rollup merge of #152590 - petrochenkov:skipedge, r=mati865
DepGraphQuery: correctly skip adding edges with not-yet-added nodes

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

The current logic already skips some edges, so I'm not sure how critical it is to have *all* the edges recorded, the logic seems to only be used for debug dumping.
Recording all edges requires supporting holes in the `LinkedGraph` data structure, to add nodes and edges out of order, https://github.com/rust-lang/rust/pull/151821 implements that at cost of complicating the data structure.
2026-02-14 18:55:38 +01:00
Jonathan Brouwer
923fb76303
Rollup merge of #152570 - Ozzy1423:attr-parse, r=JonathanBrouwer
Port #[rustc_test_marker] to the attribute parser

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

Targets:
Const is for normal tests (const test::TestDescAndFn is inserted before the test fn)
Const/Static/Fn is for custom_test_framework's #[test_case] e.g. tests/ui/custom_test_frameworks/full.rs

r? @JonathanBrouwer

Again I left the use-sites as is since they are early uses.
2026-02-14 18:55:37 +01:00