Commit graph

317973 commits

Author SHA1 Message Date
Urgau
be697c5504
Rollup merge of #152477 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 1a02979fae.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
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
Urgau
0de4f5bd6a
Rollup merge of #137487 - Voultapher:stabilize-assert-matches, r=Amanieu
Stabilize `assert_matches`

Closes https://github.com/rust-lang/rust/issues/82775

This is a revive of https://github.com/rust-lang/rust/pull/120234, with the suggested move from the public `assert_matches` module to `macros`. This necessitates the rename of the internal macros modules to `core_macros` and `std_macros` respectively.
2026-02-12 00:04:14 +01:00
Urgau
50d99fb8a9
Rollup merge of #152505 - cuviper:relnotes-1.93.1, r=Urgau
Sync relnotes for stable 1.93.1

These were added to the stable branch in rust-lang/rust#152450.
2026-02-12 00:04:13 +01:00
Josh Stone
1cb71f9d22 Sync relnotes for stable 1.93.1 2026-02-11 14:22:56 -08:00
bors
7057231bd7 Auto merge of #152428 - nikic:llvm-22-rc3, r=dianqk
Update to LLVM 22.1.0-rc3

Update to LLVM 22.1.0-rc3, plus a cherry-pick of https://github.com/llvm/llvm-project/pull/179631 which is still pending backport upstream.

Fixes https://github.com/rust-lang/rust/issues/151926.
Fixes https://github.com/rust-lang/rust/issues/151832.
Fixes https://github.com/rust-lang/rust/issues/151818.
Fixes https://github.com/rust-lang/rust/issues/151807.
Fixes [#t-compiler/help > Inlining causing function to get replace with TRAP](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Inlining.20causing.20function.20to.20get.20replace.20with.20TRAP/with/568824178).

Should also address https://github.com/rust-lang/rust/issues/131745, but we should verify that separately.
2026-02-11 16:57:29 +00:00
Lukas Bergdoll
2f3b952349 Stabilize assert_matches 2026-02-11 14:13:44 +01:00
bors
7dc2e92b83 Auto merge of #152240 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

27 commits in fe2f314aef06e688a9517da1ac0577bb1854d01f..0c9e687d237ff04b53ccb67b4ce63e9483789e88
2026-01-30 21:52:01 +0000 to 2026-02-11 05:58:30 +0000
- chore: downgrade to libc@0.2.180 (rust-lang/cargo#16624)
- fix(script): Load config relative to the script (rust-lang/cargo#16620)
- fix(lints): Don't run on-by-default lints when MSRV is too old (rust-lang/cargo#16618)
- fix(build): Remove deprecated, unstable --out-dir (rust-lang/cargo#16608)
- fix(script): Make the lockfile script-specific independent of build-dir (rust-lang/cargo#16619)
- fix(lockfile-path): Respect the config in fix, install (rust-lang/cargo#16617)
- chore: upgrade to gix@0.79.0 (rust-lang/cargo#16615)
- chore: downgrade to libc@0.2.179 (rust-lang/cargo#16613)
- feat(timings): Enable text selection in the charts (rust-lang/cargo#16607)
- Add host.runner for wrapping host build target executions (rust-lang/cargo#16599)
- feat(schema): Add `impl Copy for RustVersion` (rust-lang/cargo#16609)
- refactor(lints): Cleanup (rust-lang/cargo#16610)
- refactor(timings): Remove `CanvasRenderer` in favor of `SvgRenderer` (rust-lang/cargo#16602)
- Fix known hosts parsing (rust-lang/cargo#16596)
- chore: pin openssl-src to 300.5.4 (rust-lang/cargo#16601)
- chore(deps): bump time from 0.3.46 to 0.3.47 (rust-lang/cargo#16593)
- feat(lints): Add missing_lints_inheritance  (rust-lang/cargo#16588)
- chore(deps): bump git2 from 0.20.3 to 0.20.4 (rust-lang/cargo#16589)
- chore(deps): update msrv (3 versions) to v1.91 (rust-lang/cargo#16587)
- feat(lints): Add unused_workspace_package_fields lint (rust-lang/cargo#16585)
- Add command field to BuildStarted in build-analysis (rust-lang/cargo#16577)
- Fix link for lockfile-publish-time (rust-lang/cargo#16582)
- docs(cli): Discuss commands and aliases (rust-lang/cargo#16581)
- fix(script): Correct style of help message (rust-lang/cargo#16580)
- chore(deps): update compatible (rust-lang/cargo#16578)
- chore(deps): update crate-ci/typos action to v1.42.3 (rust-lang/cargo#16579)
- fix(timings): Only compute `y_ticks` when the `units` is not empty. (rust-lang/cargo#16575)
2026-02-11 12:47:14 +00:00
Asuna
4810270252 Drop dump test for type info reflection 2026-02-11 12:18:51 +01:00
Tshepang Mbambo
0f845df7dc
Merge pull request #2761 from rust-lang/tshepang/date-check
link to a policy on using new external crates
2026-02-11 12:54:28 +02:00
Weihang Lo
d517ca282f
Update cargo submodule 2026-02-11 14:46:47 +08:00
Redddy
8b189894a4
Merge pull request #2774 from reddevilmidzy/fix
Fix doc links to rustc_lexer and rustc_middle
2026-02-11 15:42:43 +09:00
reddevilmidzy
8b5a212031 Fix doc links to rustc_lexer and rustc_middle 2026-02-11 06:39:34 +00:00
Redddy
79e7093f05
Merge pull request #2773 from reddevilmidzy/review
Add reddevilmidzy to review group
2026-02-11 15:20:52 +09:00
Redddy
bdd8b21e41
Add reddevilmidzy to review group 2026-02-11 15:09:46 +09:00
bors
d34f1f9314 Auto merge of #152420 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to 6a67a9f627.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-02-11 04:12:19 +00: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
Boxy
47d49a0daa
Merge pull request #2772 from him2him2/fix-typos
Fix typos and capitalization across documentation
2026-02-10 17:27:34 +00:00
ron
e20a44db78
Fix typos and capitalization across documentation
- Fix "Github" → "GitHub" capitalization throughout (about.md, git.md,
  about-this-guide.md, debugging-support-in-rustc.md, and all
  notification-groups files)
- Fix "its self" → "itself" (macro-expansion.md, what-bootstrapping-does.md)
- Fix "MIRI" → "Miri" (overview.md, what-bootstrapping-does.md)
- Fix grammar: "to given" → "to give", "an user-specified" → "a user-specified",
  "an separate" → "a separate" (diagnostics.md, git.md)
- Fix incorrect attribute syntax: `!#[warn` → `#![warn` (diagnostics.md)
- Fix "overrides" → "override" (suggested.md)
- Fix "issue commit" → "commit message" (contributing.md)
- Fix double spaces (ty.md)
2026-02-10 11:35:43 -05: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
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
Boxy
4c9bb23107
Merge pull request #2771 from rust-lang/offload-build-docs
improve build docs
2026-02-10 12:28:26 +00:00
bors
d00ba92259 Auto merge of #152437 - JonathanBrouwer:rollup-bWpnWOz, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#152364 (Port a lot of attributes to the new parser)
 - rust-lang/rust#151954 (Add help message suggesting explicit reference cast for From/TryFrom)
 - rust-lang/rust#152148 (Move `impl Interner for TyCtxt` to its own submodule)
 - rust-lang/rust#152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
 - rust-lang/rust#152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
 - rust-lang/rust#152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
 - rust-lang/rust#150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
 - rust-lang/rust#152293 (Format heterogeneous try blocks)
 - rust-lang/rust#152355 (Update documentation of rustc_macros)
 - rust-lang/rust#152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
2026-02-10 12:04:24 +00: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
d9a86757c9
Rollup merge of #152293 - ia0:try_blocks_heterogeneous, r=ytmimi
Format heterogeneous try blocks

The tracking issue for `try_blocks_heterogeneous` is https://github.com/rust-lang/rust/issues/149488.

This follows the formatting of homogeneous try blocks (feature `try_blocks`) by considering `try bikeshed <type>` to be the equivalent of `try` (in particular a single "token").

An alternative would be to permit breaking between `bikeshed` and `<type>`, but given that those 2 elements are an explicitly temporary part of the syntax, it doesn't seem worth it. There also doesn't seem to be any existing precedent breaking between a keyword and a type. It also doesn't seem to be useful in practice, given that the type itself doesn't break (which is how it works for the return type of closures) and has more chances to dominate the length in case a break is necessary.

Happy to adapt anything in case this formatting is not optimal.

The test is also copied from homogeneous try blocks with 2 additional test cases to demonstrate the behavior with long types.

See [#t-lang > try blocks @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/try.20blocks/near/572387493) for context.
2026-02-10 13:00:48 +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
Jonathan Brouwer
935904f534
Rollup merge of #152364 - jdonszelmann:port-a-lot, r=jonathanbrouwer
Port a lot of attributes to the new parser

r? @JonathanBrouwer

See commits for which attributes
2026-02-10 13:00:44 +01:00
Jana Dönszelmann
12dbc1bc63
remove 'static in many places 2026-02-10 10:48:46 +01: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
Nikita Popov
1c45618335 Update to LLVM 22 rc 3 2026-02-10 10:11:25 +01: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