Jonathan Brouwer
4af0d1551a
Rollup merge of #153641 - nnethercote:mv-Spanned, r=JonathanBrouwer
...
Move `Spanned`.
It's defined in `rustc_span::source_map` which doesn't make any sense because it has nothing to do with source maps. This commit moves it to the crate root, a more sensible spot for something this basic.
r? @JonathanBrouwer
2026-03-10 22:46:56 +01:00
Nicholas Nethercote
c12ab08c14
Move Spanned.
...
It's defined in `rustc_span::source_map` which doesn't make any sense
because it has nothing to do with source maps. This commit moves it to
the crate root, a more sensible spot for something this basic.
2026-03-11 06:25:23 +11:00
Guillaume Gomez
744c50315d
Add missing Diag::with_span_suggestion_with_style method
2026-03-09 22:18:58 +01:00
Guillaume Gomez
4019a92ca8
Add new rustc_errors::DiagDecorator type
2026-03-09 11:19:53 +01:00
Zalathar
985b41d387
Remove the rustc_data_structures::assert_matches! re-exports
2026-03-08 22:02:23 +11:00
Josh Stone
32bae1353e
Update cfg(bootstrap)
2026-03-07 10:42:02 -08:00
Jonathan Brouwer
f540b27f90
Rollup merge of #153508 - JonathanBrouwer:improved_eager_format, r=GuillaumeGomez
...
Clean up the eager formatting API
For https://github.com/rust-lang/rust/issues/151366#event-22181360642
Previously eager formatting worked by throwing the arguments into a diag, formatting, then removing the args again. This is ugly so instead we now just do the formatting completely separately.
This PR has nice commits, so I recommend reviewing commit by commit.
r? @GuillaumeGomez
2026-03-07 01:42:37 +01:00
Jonathan Brouwer
10eb844bac
Remove eagerly_format_to_string from DiagCtxt
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
8c87d0761f
Remove eagerly_format from DiagCtxt
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
43221b43b6
Remove eagerly_format from Diag
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
828c0c0668
Remove remove_arg from diagnostics
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
c2f1e9d71d
Remove stored args from diagnostics
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
2b0552f0cb
Add new eager formatting API
2026-03-06 18:52:11 +01:00
Jonathan Brouwer
46cedc33b8
Use eager formatting in #[derive(Subdiagnostic)]
2026-03-06 18:32:54 +01:00
Jonathan Brouwer
8d96e603b1
Preserve the DiagLocation in diag_lint_level
2026-03-06 15:15:43 +01:00
Guillaume Gomez
9dc456a366
Remove usage of LintContext::span_lint in clippy
2026-03-05 23:53:53 +01:00
Jonathan Brouwer
53ef4d297e
Rollup merge of #153414 - JonathanBrouwer:translate_cleanup, r=Kivooeo
...
Rename translation -> formatting
Because there is no translation happening anymore
r? @Kivooeo
2026-03-04 19:30:42 +01:00
Jonathan Brouwer
1500680ba5
Rollup merge of #153401 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
...
Migrationg of `LintDiagnostic` - part 7
Part of https://github.com/rust-lang/rust/issues/153099 .
This PR removes the `LintDiagnostic` trait and proc-macro. \o/
r? @JonathanBrouwer
2026-03-04 19:30:40 +01:00
Jonathan Brouwer
1c44dbd580
Rollup merge of #152164 - mu001999-contrib:lint/unused_features, r=JonathanBrouwer
...
Lint unused features
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152164 )*
Fixes rust-lang/rust#44232
Fixes rust-lang/rust#151752
---
This PR records used features through query side effect, then reports unsued features finally.
2026-03-04 19:30:36 +01:00
Jonathan Brouwer
d8092147fe
Rename translation -> formatting
2026-03-04 17:47:24 +01:00
Guillaume Gomez
7ceb8ea1b0
Remove unused LintDiagnostic trait
2026-03-04 15:16:51 +01:00
Guillaume Gomez
56d636a762
Implement Diagnostic directly on Box<FnOnce...>
2026-03-03 22:14:53 +01:00
Guillaume Gomez
bd538f90fe
Remove unused rustc_errors::LintDiagnosticBox trait
2026-03-03 17:21:41 +01:00
Guillaume Gomez
924748717b
Implement Diagnostic trait for rustc_errors::DecorateDiagCompat
2026-03-03 17:21:16 +01:00
mu001999
d0a182f485
Remove unused features in compiler
2026-03-02 09:38:04 +08:00
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
6e8d9c1242
Adjust uses of format_diag_message to remove unwrap
2026-02-28 18:46:53 +01:00
Jonathan Brouwer
5a18412c93
Remove TranslationError
2026-02-28 18:34:17 +01:00
Jonathan Brouwer
66cccfde99
Rollup merge of #147859 - cyrgani:nonfatal-tokenstream-parse, r=petrochenkov,JonathanBrouwer
...
reduce the amount of panics in `{TokenStream, Literal}::from_str` calls
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/147859 )*
Before this PR, calling `TokenStream::from_str` or `Literal::from_str` with an invalid argument would always cause a compile error, even if the `TokenStream` is not used afterwards at all.
This PR changes this so it returns a `LexError` instead in some cases.
This is very theoretically a breaking change, but the doc comment on the impl already says
```
/// NOTE: some errors may cause panics instead of returning `LexError`. We reserve the right to
/// change these errors into `LexError`s later.
```
Fixes some cases of rust-lang/rust#58736 .
2026-02-22 11:31:14 +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:
* https://github.com/rust-lang/rust/commit/678211956793a2e772414a71700a21525af6e67b Removes the translation compiler options from the session
* https://github.com/rust-lang/rust/commit/8f300d02fe8d2f01a39425925afd4cf3e15a822b Removes the now empty `Translator` type
* https://github.com/rust-lang/rust/commit/ab715c536fbd4ac09409e9a44eea2e25ea8a4f48 Renames `translate_message` to `format_diag_message`, as the function no longer does any translation
* https://github.com/rust-lang/rust/commit/8bcbc3f766af6242dcb52afe1ef4f6b1a9685019 Removes a section describing the removed compiler options from the rustc dev guide
2026-02-20 22:00:57 +01:00
Esteban Küber
37684bdfc5
Make all multipart suggestions verbose
...
The ShowAlways style of suggestions is usually easier to understand than the inline style.
2026-02-18 18:33:35 +00: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
cyrgani
f1c80f5988
reduce the amount of panics in {TokenStream, Literal}::from_str calls
2026-02-11 20:09:30 +00: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
6782119567
Remove the translation compiler options
2026-02-10 22:10:22 +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
0db0acd699
Remove the fallback bundle
2026-02-08 11:06:42 +01:00
Jonathan Brouwer
ea8733133c
Remove DiagMessage::FluentIdentifier
2026-02-08 10:33:29 +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
6782a190f2
Register functions in translation
2026-02-05 16:58:48 +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