Commit graph

53871 commits

Author SHA1 Message Date
Philipp Krones
eaad11cc2c
cg_gcc: remove Clippy expect attribute 2026-02-12 16:55:36 +01:00
Shoyu Vanilla
f5a8b86695 WF check lifetime bounds for locals with type params 2026-02-13 00:33:47 +09:00
Zalathar
b9b28ba1b5 Collect active query jobs into struct QueryJobMap 2026-02-13 01:18:24 +11: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
xonx
7a2f2fe754 fix tidy 2026-02-12 12:20:36 +00:00
xonx
1eddc17989 fix GATs logic 2026-02-12 12:10:08 +00: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
Ralf Jung
590c1c9966 UnsafePinned: implement opsem effects of UnsafeUnpin 2026-02-12 09:09:35 +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
mu001999
8c77b6c025 Exclude final methods from dyn-compat check and vtable 2026-02-12 15:18:15 +08:00
mu001999
3572d482a0 Validate no override impl definitions
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:15 +08:00
mu001999
460cda8c95 Validate final usages in AST
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:09 +08:00
mu001999
7077797f52 Parse and lower final for methods
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:12:29 +08: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
9376482de2
Rollup merge of #152495 - JonathanBrouwer:remove-empty-subdiags, r=lqd
Clean up some subdiagnostics

Just a nice minor cleanup :)
* Removes some empty subdiagnostics which could just be subdiagnostic attributes
* Convert some manual implementation of `Subdiagnostic` to derives
2026-02-12 00:41:12 -05:00
Jacob Pratt
596faf0f26
Rollup merge of #152481 - bjorn3:backends_reduce_duplication, r=fmease
Use cg_ssa's produce_final_output_artifacts in cg_clif
2026-02-12 00:41:11 -05:00
Jacob Pratt
9cbcd11ae4
Rollup merge of #152425 - Ozzy1423:test-runner, r=JonathanBrouwer
Port #![test_runner] to the attribute parser

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

r? @JonathanBrouwer
2026-02-12 00:41:10 -05:00
Jacob Pratt
3ba1a835d1
Rollup merge of #152316 - cuiweixie:bugfix-continue, r=petrochenkov
fix: add continue

 should be same in:
d3ec6a351a/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs (L156-L159)
2026-02-12 00:41:09 -05:00
Jacob Pratt
8193067abd
Rollup merge of #152498 - petrochenkov:revoverglob, r=jieyouxu
Partially revert "resolve: Update `NameBindingData::vis` in place"

Partial revert of 227e7bd48b.
This is a minimal fix for backporting to beta, I'll submit proper fixes later.

Fixes rust-lang/rust#152004
Fixes rust-lang/rust#151124
Fixes rust-lang/rust#152347
2026-02-12 00:41:09 -05:00
Jacob Pratt
c41f9343e9
Rollup merge of #152478 - bjorn3:lto_refactors10, r=wesleywiser
Remove tm_factory field from CodegenContext

This is necessary to support serializing the `CodegenContext` to a `.rlink` file in the future for moving LTO to the `-Zlink-only` step.

Follow up to https://github.com/rust-lang/rust/pull/149209
Part of https://github.com/rust-lang/compiler-team/issues/908
2026-02-12 00:41:08 -05:00
Jacob Pratt
0e746d0a25
Rollup merge of #152434 - Zalathar:call-query, r=nnethercote
Clarify names of `QueryVTable` functions for "executing" a query

In the query system, there are several layers of functions involved in “executing” a query, with very different responsibilities at each layer, making it important to be able to tell them apart.

This PR renames two of the function pointers in `QueryVTable`, along with their associated helper functions, to hopefully do a better job of indicating what their actual responsibilities are.

r? nnethercote
2026-02-12 00:41:08 -05:00
Jacob Pratt
3ad8e9ce04
Rollup merge of #152159 - JohnTitor:issue-74756, r=estebank
Add note for `?Sized` params in int-ptr casts diag

Close rust-lang/rust#74756
2026-02-12 00:41:07 -05:00
Jacob Pratt
e4375da4e8
Rollup merge of #151863 - amandasystems:streamline-borrow-error-handling, r=lcnr
Borrowck: simplify diagnostics for placeholders

This folds the call to `region_from_element` into `RegionInferenceContext`, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a `RegionElement` leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from rust-lang/rust#142623.

r? @lcnr
2026-02-12 00:41:07 -05:00
Jacob Pratt
3db13e22b7
Rollup merge of #151814 - lcnr:silent-layout-error, r=jackh726
layout: handle rigid aliases without params

fixes rust-lang/rust#151791

r? types
2026-02-12 00:41:07 -05:00
Jacob Pratt
2dba56033e
Rollup merge of #151152 - nik-contrib:helper_attr_builtin, r=chenyukang
Add FCW for derive helper attributes that will conflict with built-in attributes

Adds a future-compatibility-warning deny-by-default lint that helps catch invalid derive helper attribute names early.

This issues the lint, saying that `ignore` helper will clash with the built-in `ignore` attribute.

```rust
#![crate_type = "proc-macro"]
#![deny(ambiguous_derive_helpers)]
use proc_macro::TokenStream;

#[proc_macro_derive(Trait, attributes(ignore))]
pub fn example(input: TokenStream) -> TokenStream {
    TokenStream::new()
}
```

If you actually tried to use that `ignore` helper attribute, you won't be able to due to the ambiguity:

```rust
#[derive(Trait)]
struct Foo {
    #[ignore]
    field: (),
}
```

Produces:

```
error[E0659]: `ignore` is ambiguous
 --> src/lib.rs:5:7
  |
5 |     #[ignore]
  |       ^^^^^^ ambiguous name
  |
  = note: ambiguous because of a name conflict with a builtin attribute
  = note: `ignore` could refer to a built-in attribute
note: `ignore` could also refer to the derive helper attribute defined here
 --> src/lib.rs:3:10
  |
3 | #[derive(Trait)]
  |          ^^^^^
```
2026-02-12 00:41:06 -05:00
Jacob Pratt
0041f221ea
Rollup merge of #150768 - bjorn3:llvm_intrinsic_no_fn_abi, r=wesleywiser
Don't compute FnAbi for LLVM intrinsics in backends

~~This removes support for `extern "unadjusted"` for anything other than LLVM intrinsics. It only makes sense in the context of calling LLVM intrinsics anyway as it exposes the way the LLVM backend internally represents types. Perhaps it should be renamed to `extern "llvm-intrinsic"`?~~

Follow up to https://github.com/rust-lang/rust/pull/148533
2026-02-12 00:41:06 -05:00
Jacob Pratt
b1b6533077
Rollup merge of #142680 - beetrees:sparc64-float-struct-abi, r=tgross35
Fix passing/returning structs with the 64-bit SPARC ABI

Fixes the 64-bit SPARC part of rust-lang/rust#115609 by replacing the current implementation with a new implementation modelled on the RISC-V calling convention code ([SPARC ABI reference](https://sparc.org/wp-content/uploads/2014/01/SCD.2.4.1.pdf.gz)).

Pinging `sparcv9-sun-solaris` target maintainers: @psumbera @kulikjak
Fixes rust-lang/rust#115336
Fixes rust-lang/rust#115399
Fixes rust-lang/rust#122620
Fixes https://github.com/rust-lang/rust/issues/147883
r? @workingjubilee
2026-02-12 00:41:05 -05:00
Jacob Pratt
c509454f89
Rollup merge of #142415 - xizheyin:141679, r=estebank
Add note when inherent impl for a alias type defined outside of the crate

Fixes rust-lang/rust#141679

r? compiler
2026-02-12 00:41:05 -05:00
bors
605f49b274 Auto merge of #152506 - Urgau:rollup-MlGAszj, r=Urgau
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152505 (Sync relnotes for stable 1.93.1)
 - rust-lang/rust#137487 (Stabilize `assert_matches`)
 - rust-lang/rust#152281 (borrowck: suggest `&mut *x` for pattern reborrows)
 - rust-lang/rust#151142 (Support ADT types in type info reflection)
 - rust-lang/rust#152477 (rustc-dev-guide subtree update)
 - rust-lang/rust#152488 (allow `deprecated(since = "CURRENT_RUSTC_VERSION")`)
 - rust-lang/rust#152491 (Remove unused `fluent-syntax` dependency from tidy)
2026-02-12 03:44:50 +00:00
Urgau
f8203c657d
Rollup merge of #152488 - cyrgani:deprecation-staged-api, r=JonathanBrouwer
allow `deprecated(since = "CURRENT_RUSTC_VERSION")`

Motivated by https://github.com/rust-lang/rust/pull/149978.
2026-02-12 00:04:16 +01:00
Urgau
c87a89ed14
Rollup merge of #151142 - SpriteOvO:type-info-adt, r=oli-obk
Support ADT types in type info reflection

Tracking issue: rust-lang/rust#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](https://github.com/rust-lang/rust/pull/146923#discussion_r2372249477)), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang/rust#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](https://github.com/rust-lang/rust/pull/151142#discussion_r2777920512))

r? @oli-obk
2026-02-12 00:04:15 +01:00
Urgau
050b48a693
Rollup merge of #152281 - JohnTitor:sugg-mut-deref-borrows, r=estebank
borrowck: suggest `&mut *x` for pattern reborrows

Fixes rust-lang/rust#81059
r? @estebank as you should have some context here, but feel free to re-assign if you don't have time to review right now.
2026-02-12 00:04:14 +01:00
cyrgani
52919c7f81 allow deprecated(since = "CURRENT_RUSTC_VERSION") 2026-02-11 21:39:22 +00:00
Vadim Petrochenkov
324267ccaa Partially revert "resolve: Update NameBindingData::vis in place" 2026-02-11 22:27:56 +03:00
Manuel Drehwald
c89a89bb14 Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto 2026-02-11 14:08:56 -05:00
Jonathan Brouwer
ab4891ce74
Convert some impl Subdiagnostics to derives 2026-02-11 19:45:04 +01:00
Jonathan Brouwer
635dcd819a
Remove some empty subdiagnostics 2026-02-11 19:23:46 +01:00
Lukas Bergdoll
2f3b952349 Stabilize assert_matches 2026-02-11 14:13:44 +01:00
Matthias Krüger
336debab2e
Rollup merge of #152383 - RalfJung:BikeshedGuaranteedNoDrop, r=TaKO8Ki
BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable

Not sure if that's worth it, maybe this goes without saying for all these builtin traits?
2026-02-11 13:48:50 +01:00
Matthias Krüger
dbb1c20f47
Rollup merge of #152372 - nyurik:clippy-rustc_trait_selection, r=mati865
style: remove unneeded trailing commas

Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.

I'm working on a [clippy lint](https://github.com/rust-lang/rust-clippy/pull/16530) to make this process automatic.
2026-02-11 13:48:49 +01:00
Matthias Krüger
9a4ce0b5f7
Rollup merge of #152146 - zedddie:mgca-improve-const-bindings-wfck, r=BoxyUwU
mGCA: Add associated const type check

rust-lang/rust#151642

r? BoxyUwU

I didn't bless tests just yet as it only fixes the dyn arm
2026-02-11 13:48:49 +01:00
Matthias Krüger
92e3972ca7
Rollup merge of #152021 - madsmtm:tvos-visionos-watchos-tier-2, r=shepmaster
Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2

Promote the following targets to Tier 2 without host tools:
- `aarch64-apple-tvos`.
- `aarch64-apple-tvos-sim`.
- `aarch64-apple-watchos`.
- `aarch64-apple-watchos-sim`.
- `aarch64-apple-visionos`.
- `aarch64-apple-visionos-sim`.

This implements MCP https://github.com/rust-lang/compiler-team/issues/918. Fixes https://github.com/rust-lang/rust/issues/151705.

r? shepmaster
2026-02-11 13:48:48 +01:00
Matthias Krüger
88eda646f2
Rollup merge of #152431 - oli-obk:limited_stability_attr, r=jdonszelmann
Restrict the set of things that const stability can be applied to

r? @jdonszelmann
2026-02-11 13:48:47 +01:00
Matthias Krüger
2194af9680
Rollup merge of #152419 - nnethercote:mv-more-query-system-code, r=Zalathar
Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
2026-02-11 13:48:46 +01:00
bjorn3
1106018af0 Use cg_ssa's produce_final_output_artifacts in cg_clif 2026-02-11 12:36:19 +00:00