Commit graph

53871 commits

Author SHA1 Message Date
bjorn3
f49223c443 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.
2026-02-11 12:18:04 +00:00
Oscar Bray
d1f11fd734 Port #![test_runner] to the attribute parser 2026-02-11 11:33:49 +00:00
bjorn3
2d07e81a5c Move target machine factory error reporting into codegen backend 2026-02-11 10:53:38 +00:00
bjorn3
70587ce07c Remove a couple of unused errors 2026-02-11 10:39:48 +00:00
Shoyu Vanilla
955f7750c1 Remove redundant shallow_resolve call 2026-02-11 18:08:14 +09:00
Shoyu Vanilla
13a83cb639 Shallow resolve ty and const vars to their root vars 2026-02-11 17:38:34 +09:00
Shoyu Vanilla
1f53258660 Bump ena 2026-02-11 17:05:50 +09:00
Zalathar
0de45db240 Clarify names of QueryVTable functions for "executing" a query
This also changes the signature of `call_query_method` to not return a value,
because its only caller immediately discards the value anyway.
2026-02-11 16:50:10 +11:00
bors
7b25457166 Auto merge of #151943 - Zalathar:cache-on-disk, r=TaKO8Ki
Clean up query macros for `cache_on_disk_if`

This PR aims to make the macros for dealing with `cache_on_disk_if` a bit easier to read and work with.

There should be no change to compiler behaviour.
2026-02-10 20:57:44 +00:00
Nik Revenco
846e4ee5dc Add FCW for derive helper attributes that will conflict with built-in attributes 2026-02-10 19:39:19 +00:00
xonx
071d0cd9f2 rewording note and refer issue 2026-02-10 18:42:52 +00:00
xonx
c576dc55b8 delete middle check.
Co-authored-by: lcnr <rust@lcnr.de>
2026-02-10 18:42:51 +00:00
xonx
a873a3fe77 add suggested changes 2026-02-10 18:42:50 +00:00
xonx4l
5b1070b040 Add note for param-env shadowing 2026-02-10 18:42:50 +00:00
Amanda Stjerna
f53eed56d2
Borrowck: simplify diagnostics for placeholders.
This essentially folds the call to `region_from_element` into `RegionInferenceContext`,
and simplifies the error variant for this case. It also clarifies the type
information on the methods called to emphasise the fact that they only ever use
placeholder regions in the diagnostics, and completely ignore any other element.
2026-02-10 19:39:57 +01:00
lcnr
39a532445a prevent incorrect layout error
aliases may be rigid even if they don't reference params. If the alias isn't well-formed, trying to normalize it as part of the input should have already failed
2026-02-10 18:00:42 +00:00
Mads Marquart
4a01f22a3e Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2 2026-02-10 17:42:12 +01:00
bors
9e79395f92 Auto merge of #151509 - Zoxc:gen-color-race, r=zetanumbers,petrochenkov
Handle race when coloring nodes concurrently as both green and red

This fixes a race where a duplicate dep node gets written to the dep graph if a node was marked as green and promoted during execution, then marked as red after execution.

This can occur when a `no_hash` query A depends on a query B which cannot be forced so it was not colored when starting execution of query A. During the execution of query A it will execute query B and color it green. Before A finishes another thread tries to mark A green, this time succeeding as B is now green, and A gets promoted and written to metadata. Execution of A then finishes and because it's `no_hash` we assume the result changed and thus we color the node again, now as red and write it to metadata again. This doesn't happen with non-`no_hash` queries as they will be green if all their dependencies are green.

This changes the code coloring nodes red to also use `compare_exchange` to deal with this race ensuring that the coloring of nodes only happens once.

Fixes rust-lang/rust#150018
Fixes rust-lang/rust#142778
Fixes rust-lang/rust#141540
2026-02-10 16:17:00 +00:00
ron
11e4873b96 Fix typos and grammar in compiler and build documentation
- compiler/rustc_codegen_llvm/src/debuginfo/doc.md: fix 5 issues
  (adaption → adaptation, "allow to" → "allow V-ing" x3, later → latter + plural)
- compiler/rustc_thread_pool/src/sleep/README.md: fix 2 issues
  (idle → active per context, then → than)
- src/bootstrap/README.md: fix 2 issues (rust → Rust, add missing article "the")
- src/ci/docker/README.md: fix 2 issues ("come form" → "come from", grammar)
2026-02-10 10:22:05 -05:00
Asuna
6ab6734d4b Move ADT related code to a sub module for type info 2026-02-10 14:08:35 +01:00
Asuna
a575fe168f Erase type lifetime before writing type ID 2026-02-10 14:08:11 +01:00
Asuna
b410cb01fe Simplify the writing of tuple type info 2026-02-10 13:53:27 +01:00
Asuna
98e0c34f7f Support unions in type info reflection 2026-02-10 13:53:27 +01:00
Asuna
e9037882c1 Support enums in type info reflection 2026-02-10 13:53:26 +01:00
Asuna
870fd9070b Add generics info for structs in type info 2026-02-10 13:45:09 +01:00
Asuna
b23d308853 Support structs in type info reflection 2026-02-10 13:45:07 +01:00
Jonathan Brouwer
083622cdd0
Rollup merge of #152396 - ShoyuVanilla:uplift-allow-normalize, r=lcnr
Uplift `Predicate::allow_normalization` to `rustc_type_ir`

Found this FIXME comment while fixing a bug in rust-analyzer 😄
cc https://github.com/rust-lang/rust-analyzer/pull/21611

r? types
2026-02-10 13:00:49 +01:00
Jonathan Brouwer
faa15808cf
Rollup merge of #152355 - JonathanBrouwer:update-macro-doc, r=nnethercote
Update documentation of rustc_macros

Update the docs to reflect the changes in https://github.com/rust-lang/rust/issues/151366
2026-02-10 13:00:49 +01:00
Jonathan Brouwer
b5cf35214f
Rollup merge of #150688 - Zalathar:check-pat-lit, r=petrochenkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns

Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.

`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.

There should be no actual change to compiler behaviour.
2026-02-10 13:00:48 +01:00
Jonathan Brouwer
5541e5c057
Rollup merge of #152417 - Zalathar:arena-alloc, r=nnethercote
Move the needs-drop check for `arena_cache` queries out of macro code

This is slightly simpler than before, because now the macro only needs to call a single function, and can just unconditionally supply `tcx` and a typed arena.

There should be no actual change to compiler behaviour.
2026-02-10 13:00:47 +01:00
Jonathan Brouwer
70ef5048d4
Rollup merge of #152351 - JonathanBrouwer:remove_subdiag, r=nnethercote
Remove `SubdiagMessage` in favour of the identical `DiagMessage`

For https://github.com/rust-lang/rust/issues/151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
2026-02-10 13:00:47 +01:00
Jonathan Brouwer
2af7bc0e17
Rollup merge of #152226 - fmease:modernize-indeterminate-object-lifetime-diag, r=chenyukang
Modernize diagnostic for indeterminate trait object lifetime bounds

* remove suggestion from the diagnostic message (bad style, too long) and turn it into a structured suggestion
* replace *object type* with *trait object type* since the former is an outdated term
2026-02-10 13:00:46 +01:00
Jonathan Brouwer
2aaf3a19d5
Rollup merge of #152148 - Zalathar:tcx-interner, r=petrochenkov
Move `impl Interner for TyCtxt` to its own submodule

This impl is several hundred lines of mostly self-contained, mostly boilerplate code that can be extracted out of the dauntingly large `rustc_middle::ty::context` module.

- The trait and its impl were introduced by https://github.com/rust-lang/rust/pull/97287.

---

There should be no change to compiler behaviour.
2026-02-10 13:00:45 +01:00
Jonathan Brouwer
39bb68119d
Rollup merge of #151954 - Muhtasim-Rasheed:issue-109829-help-message, r=eholk
Add help message suggesting explicit reference cast for From/TryFrom

Closes rust-lang/rust#109829

Improves E0277 diagnostics when a `From` or `TryFrom` implementation is expected, but the provided type is a reference that can be explicitly cast to a type the trait can convert from.
2026-02-10 13:00:45 +01:00
Folkert de Vries
c9b5c934ca
Fix passing/returning structs with the 64-bit SPARC ABI
Co-authored-by: beetrees <b@beetr.ee>
2026-02-10 12:39:45 +01:00
Oli Scherer
85e8282fab Start using pattern types in libcore 2026-02-10 11:19:24 +00:00
Jana Dönszelmann
12dbc1bc63
remove 'static in many places 2026-02-10 10:48:46 +01:00
Oli Scherer
475b9d9819 Prevent const stability attrs from being applied to macros via the normal attribute logic instead of special cased checks 2026-02-10 09:48:03 +00:00
Oli Scherer
628c37afad Restrict the set of things that const stability can be applied 2026-02-10 09:36:59 +00:00
Jana Dönszelmann
fe7530cad2
Make rustc_object_lifetime_default use NoArgsAttributeParser 2026-02-10 10:36:16 +01:00
Jana Dönszelmann
eab26e329b
Port rustc_no_mir_inline to the new attribute parser 2026-02-10 10:25:19 +01:00
Jana Dönszelmann
f4c135f91b
Port rustc_trivial_field_reads to the new attribute parser 2026-02-10 10:19:08 +01:00
Jonathan Brouwer
2377d355ad
Update documentation of rustc_macros 2026-02-10 10:17:59 +01:00
Jana Dönszelmann
954f483557
Port rustc_never_type_options to the new attribute parser 2026-02-10 10:17:24 +01:00
Jonathan Brouwer
ea361287be Remove SubdiagMessage in favour of the identical DiagMessage 2026-02-10 09:13:45 +00:00
Jana Dönszelmann
a17eb934db
Port rustc_capture_analysis to the new attribute parser 2026-02-10 10:10:38 +01:00
Jana Dönszelmann
9d10b2ff37
Port rustc_conversion_suggestion to the new attribute parser 2026-02-10 10:10:38 +01:00
Jana Dönszelmann
9cc2924959
Port rustc_deprecated_safe_2024 to the new attribute parser 2026-02-10 10:10:38 +01:00
Jana Dönszelmann
00fef81964
Port rustc_expected_cgu_reuse to the new attribute parser 2026-02-10 10:10:38 +01:00
Nicholas Nethercote
a34317e5a5 Move report_cycle.
From `rustc_query_system::query::job` to `rustc_query_impl::job`.
2026-02-10 18:46:05 +11:00