Jonathan Brouwer
51f35d76a2
Pass DiagArgMap instead of FluentArgs into format_diag_message
2026-03-01 10:07:39 +01:00
Jonathan Brouwer
5ade46246e
Move DiagArgMap to rustc_error_messages
2026-03-01 10:07:36 +01:00
Jonathan Brouwer
5a18412c93
Remove TranslationError
2026-02-28 18:34:17 +01:00
Jonathan Brouwer
b0cdafbd4a
Rollup merge of #152455 - JonathanBrouwer:remove_translation, r=jdonszelmann
...
Remove the translation `-Z` options and the `Translator` type.
This PR implements MCP https://github.com/rust-lang/compiler-team/issues/967
It is split up into individually reviewable commits, each commit passes tests:
* 6782119567 Removes the translation compiler options from the session
* 8f300d02fe Removes the now empty `Translator` type
* ab715c536f Renames `translate_message` to `format_diag_message`, as the function no longer does any translation
* 8bcbc3f766 Removes a section describing the removed compiler options from the rustc dev guide
2026-02-20 22:00:57 +01:00
Jonathan Brouwer
018a5efcf7
Rename inline_fluent! to msg!
2026-02-14 13:47:52 +01:00
Jonathan Brouwer
f1b935d08f
Rollup merge of #152356 - JonathanBrouwer:inline_diag4, r=jdonszelmann
...
Improve the `inline_fluent!` macro
For https://github.com/rust-lang/rust/issues/151366
This PR turns `inline_fluent!` into a proc macro, so we can run validation on the messages in this macro :)
I started a thread here because I don't like the name of the macro, but that's for a future PR: [#t-compiler > Bikeshed the new `inline_fluent!` macro](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Bikeshed.20the.20new.20.60inline_fluent!.60.20macro/with/572646242 )
2026-02-13 13:35:01 +01:00
mu001999
a07f837491
Remove unused features in compiler
2026-02-13 09:25:39 +08:00
Jonathan Brouwer
ab715c536f
Rename translate_message to format_diag_message
2026-02-11 17:52:00 +01:00
Jonathan Brouwer
8f300d02fe
Remove the Translator type
2026-02-11 17:52:00 +01:00
Lukas Bergdoll
2f3b952349
Stabilize assert_matches
2026-02-11 14:13:44 +01:00
Jonathan Brouwer
ea361287be
Remove SubdiagMessage in favour of the identical DiagMessage
2026-02-10 09:13:45 +00:00
Jonathan Brouwer
6eb2a8fa9e
Reformat existing error messages
2026-02-09 19:12:22 +01:00
Jonathan Brouwer
81d4214604
Remove fluent tests in rustc_error
2026-02-08 11:06:42 +01:00
Jonathan Brouwer
d96d73fd86
Rollup merge of #152140 - bjorn3:driver_fixed_error_codes, r=jdonszelmann
...
Hard code the error code registry for custom drivers
And do some cleanups enabled by this.
2026-02-06 10:06:45 +01:00
Jonathan Brouwer
e55eb45661
Convert to inline diagnostics in rustc_errors
2026-02-05 12:14:48 +01:00
bjorn3
639cb694df
Replace Registry type with a lazily initialized static
...
And move try_find_description to rustc_errors::codes.
2026-02-05 10:54:46 +00:00
bjorn3
1851937577
Hard code the error code registry for custom drivers
2026-02-04 21:21:15 +00:00
Jacob Pratt
4a983e0900
Rollup merge of #151439 - Mark-Simulacrum:bootstrap-bump, r=nnethercote
...
Bump bootstrap compiler to 1.94
https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2026-01-22 00:37:43 -05:00
Mark Rousskov
3dc7a1f33b
Bump stage0
2026-01-21 20:03:56 -05:00
bjorn3
3ccabc6a8d
Remove old error emitter
...
This completes the transition to annotate-snippets
2026-01-21 12:14:51 +00:00
Jacob Pratt
2206d935f7
Rollup merge of #149209 - lto_refactors8, r=jackh726
...
Move LTO to OngoingCodegen::join
This will make it easier to in the future move all this code to link_binary.
Follow up to https://github.com/rust-lang/rust/pull/147810
Part of https://github.com/rust-lang/compiler-team/issues/908
2026-01-21 02:04:01 -05:00
Jonathan Brouwer
e8c3dd36f8
Rollup merge of #151326 - translated, r=davidtwco
...
Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`
This variant did not seem to be meaningfully different from `DiagMessage::Str`.
Am I missing something or was this just an oversight?
r? @davidtwco
2026-01-19 20:53:24 +01:00
Jonathan Brouwer
f50f5dc494
Remove all usages of #[rustc_lint_diagnostics]
2026-01-19 17:39:54 +01:00
Jonathan Brouwer
0ee7d96253
Remove all allows for diagnostic_outside_of_impl and untranslatable_diagnostic throughout the codebase
...
This PR was mostly made by search&replacing
2026-01-19 17:39:49 +01:00
Zalathar
7ec34defe9
Temporarily re-export assert_matches! to reduce stabilization churn
2026-01-19 18:26:53 +11:00
Jonathan Brouwer
ec787b07fd
Remove DiagMessage::Translated in favour of DiagMessage::Str
2026-01-18 18:30:11 +01:00
Matthias Krüger
bf399241fe
Rollup merge of #146584 - cyrgani:error-codes-macro, r=GuillaumeGomez
...
remove duplicated columns from `rustc_error_code::error_codes!`
Possible because of rust-lang/rust#146308 ~~, but currently still blocked on the next stage0 bump~~.
2025-12-11 22:09:52 +01:00
bors
ba86c0460b
Auto merge of #149704 - matthiaskrgr:rollup-u4zhw99, r=matthiaskrgr
...
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#146826 (Implement `Allocator` for `&mut A` where `A: Allocator + ?Sized`)
- rust-lang/rust#148487 (add Option::into_flat_iter)
- rust-lang/rust#148814 (stabilize `array_windows`)
- rust-lang/rust#149401 (Fix `name()` functions for local defs in rustc_public)
- rust-lang/rust#149683 (Fix armv8r-none-eabihf tier)
r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 12:25:12 +00:00
Matthias Krüger
8a6f82efac
Rollup merge of #148814 - bend-n:stabilize_array_windows, r=scottmcm
...
stabilize `array_windows`
Tracking issue: rust-lang/rust#75027
Closes : rust-lang/rust#75027
FCP completed: https://github.com/rust-lang/rust/issues/75027#issuecomment-3477510526
2025-12-06 09:57:59 +01:00
Jonathan Brouwer
8f59eb0177
Move attribute lints to rustc_lint
2025-12-05 14:22:52 +01:00
bors
47cd7120d9
Auto merge of #147634 - fmease:mv-var-to-dyn-buf-lints-next, r=jdonszelmann
...
Move even more early buffered lints to dyn lint diagnostics
Follow-up to https://github.com/rust-lang/rust/pull/145881 and https://github.com/rust-lang/rust/pull/145747 .
I originally wanted to migrate most if not the entire rest of the early buffered lints. However, when trying to migrate the buffered lints used by check-cfg I encountered a roadblock. Namely, it depends on `TyCtxt` (well, `Option<TyCtxt>`) which makes it quite hard to migrate (see also https://github.com/rust-lang/rust/pull/147634#issuecomment-3398174584 , https://github.com/rust-lang/rust/pull/147634#issuecomment-3398207128 & rust-lang/rust#149215 ).
So for now, I won't migrate it (maybe rust-lang/rust#149215 will find a solution), nor will I migrate the rest since it's quite tedious to migrate these. I'll leave them for future me.
2025-12-02 07:33:36 +00:00
bendn
919e46f4d4
stabilize [T]::array_windows
2025-12-02 00:37:17 +07:00
Matthias Krüger
ab2cdfc884
Rollup merge of #149433 - scottmcm:delay-layout-ICEs, r=jdonszelmann
...
Use a delayed bug for this layout ICE
Fixes rust-lang/rust#144501
cc `@matthiaskrgr`
2025-12-01 18:35:11 +01:00
León Orell Valerian Liehr
109e5e5999
Move early buffered lint ambigous-glob-imports to a dyn lint diagnostic
2025-12-01 16:31:53 +01:00
Scott McMurray
673be1b82a
Use a delayed bug for this layout ICE
...
Fixes 144501
2025-11-28 14:49:42 -08:00
bjorn3
b13bb4b2da
Move LTO to OngoingCodegen::join
2025-11-23 10:33:52 +00:00
bors
c268b39984
Auto merge of #148882 - 20jasper:patch-1, r=nnethercote,Kivooeo
...
Fix typo in comment in rustc_errors
It seems "CharPose" was a typo since I couldn't find any references to it anywhere else in the codebase
2025-11-23 07:26:56 +00:00
Jacob Asper
548b5d2406
lowercase usize
...
Co-authored-by: Kivooeo <75776246+Kivooeo@users.noreply.github.com >
2025-11-22 22:25:51 -05:00
Ralf Jung
bad7d36c33
flush_delayed: add note about stashed diagnostics
2025-11-17 12:09:57 +01:00
Jacob Asper
41e236a0df
Fix typo in comment in rustc_errors
...
It seems "CharPose" was a typo since I couldn't find any references to it anywhere else in the codebase
2025-11-12 15:26:05 -05:00
bjorn3
973c7527b4
Unify the configuration of the compiler docs
...
Previously it was rather inconsistent which crates got the rust logo and
which didn't and setting html_root_url was forgotten in many cases.
2025-11-05 11:25:27 +00:00
Rémy Rakic
a2b48332ba
Revert "Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov"
...
This reverts commit 99317ef14d , reversing
changes made to 9cd272dc85 .
2025-10-23 18:18:35 +00:00
bors
dc1feabef2
Auto merge of #147207 - Muscraft:anstyle-anstream, r=davidtwco
...
refactor: Move to anstream + anstyle for styling
`rustc` uses [`termcolor`](https://crates.io/crates/termcolor ) for styling and writing, while `annotate-snippets` uses [`anstyle`](https://crates.io/crates/anstyle ) for styling and currently writes directly to a `String`. When rendering directly to a terminal, there isn't/shouldn't be any differences. Still, there are differences in the escape sequences, which leads to slightly different output in JSON and SVG tests. As part of my work to have `rustc` use `annotate-snippets`, and to reduce the test differences between the two, I switched `rustc` to use `anstlye` and [`anstream`](https://crates.io/crates/anstream ) for styling and writing.
The first commit migrates to `anstyle` and `anstream` and notably does not change the output. This is because it includes extra formatting to ensure that `anstyle` + `anstream` match the current output exactly. Most of this code is unnecessary, as it adds redundant resets or uses 256-color (8-bit) when it could be using 4-bit color. The subsequent commits remove this extra formatting while maintaining the correct output when rendered.
[Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/annotate-snippets.20hurdles )
2025-10-22 16:22:51 +00:00
Scott Schafer
a484119046
refactor: Use plain ansi colors for output
2025-10-20 12:13:26 -06:00
Scott Schafer
926d4535cd
refactor: Move to anstream + anstyle for styling
2025-10-20 12:13:25 -06:00
relaxcn
ad67c9d581
fix: Use untrimmed line numbers for trimmed suggestions
2025-10-19 23:58:04 +08:00
cyrgani
321cd2aa25
remove duplicated columns from rustc_error_code::error_codes!
2025-09-27 12:29:54 +02:00
Scott Schafer
b307a1146b
fix: Filter suggestion parts that match existing code
2025-09-04 17:42:13 -06:00
Scott Schafer
81557349be
refactor: Move assert for disjoint substitution spans
2025-09-04 17:42:13 -06:00
Samuel Moelius
5e9b655e70
Correct typo in rustc_errors comment
2025-09-02 08:43:34 -04:00