Rollup merge of #152250 - JonathanBrouwer:convert_finish, r=jdonszelmann

Remove support for slugs in diagnostic messages

This PR contains 5 commits, and is best reviewed commit-by-commit:
- https://github.com/rust-lang/rust/pull/152250/changes/ea8733133cacf4496a2766b3d002492cc29ea7bf Removes support from slugs from `rustc_errors`
- https://github.com/rust-lang/rust/pull/152250/changes/62dd37131f6f43d0dab3e26cf125cd841a08e003 Removes support from slugs from `rustc_macros` (which declares `derive(Diagnostic)`)
- https://github.com/rust-lang/rust/pull/152250/changes/2289e6cfb7e379eba777a10df0a6f474f9450b02 Adjuist the `ui-fulldeps` testsuite to match the changes in `rustc_macros`
- https://github.com/rust-lang/rust/pull/152250/changes/0db0acd6993cbdf84384b00773d7509df6bc20fb Removes support for the fallback bundle (which previously contained all messages, but is now empty) from `rustc_driver_impl` and `rustc_session`
- https://github.com/rust-lang/rust/pull/152250/changes/81d42146040c4a6b3d252e3dc3ac32e563694796 Removes an integration test that tested the translation system using fluent
This commit is contained in:
Jonathan Brouwer 2026-02-08 19:15:25 +01:00 committed by GitHub
commit 7fbde8b9c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 217 additions and 660 deletions

View file

@ -29,7 +29,7 @@ pub fn main() {
}
fn parse() {
let psess = ParseSess::new(vec![]);
let psess = ParseSess::new();
let path = Path::new(file!());
let path = path.canonicalize().unwrap();

View file

@ -219,7 +219,7 @@ fn main() {
}
fn run() {
let psess = ParseSess::new(vec![]);
let psess = ParseSess::new();
iter_exprs(2, &mut |mut e| {
// If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,

View file

@ -196,7 +196,7 @@ fn main() -> ExitCode {
};
rustc_span::create_default_session_globals_then(|| {
let psess = &ParseSess::new(vec![]);
let psess = &ParseSess::new();
for &source_code in EXPRS {
let Some(expr) = parse_expr(psess, source_code) else {

View file

@ -64,7 +64,6 @@ fn compile(code: String, output: PathBuf, sysroot: Sysroot, linker: Option<&Path
output_dir: None,
ice_file: None,
file_loader: None,
locale_resources: Vec::new(),
lint_caps: Default::default(),
psess_created: None,
hash_untracked_state: None,

View file

@ -45,9 +45,9 @@ struct Hello {}
//~^ ERROR unsupported type attribute for diagnostic derive enum
enum DiagnosticOnEnum {
Foo,
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
Bar,
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
}
#[derive(Diagnostic)]
@ -59,28 +59,28 @@ struct WrongStructAttrStyle {}
#[derive(Diagnostic)]
#[nonsense("this is an example message", code = E0123)]
//~^ ERROR `#[nonsense(...)]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified
//~^^ ERROR diagnostic message not specified
//~^^^ ERROR cannot find attribute `nonsense` in this scope
struct InvalidStructAttr {}
#[derive(Diagnostic)]
#[diag(code = E0123)]
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
struct InvalidLitNestedAttr {}
#[derive(Diagnostic)]
#[diag(nonsense("foo"), code = E0123, slug = "foo")]
//~^ ERROR derive(Diagnostic): diagnostic slug not specified
//~^ ERROR derive(Diagnostic): diagnostic message not specified
struct InvalidNestedStructAttr1 {}
#[derive(Diagnostic)]
#[diag(nonsense = "...", code = E0123, slug = "foo")]
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
struct InvalidNestedStructAttr2 {}
#[derive(Diagnostic)]
#[diag(nonsense = 4, code = E0123, slug = "foo")]
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
struct InvalidNestedStructAttr3 {}
#[derive(Diagnostic)]
@ -109,15 +109,15 @@ struct CodeSpecifiedTwice {}
#[derive(Diagnostic)]
#[diag("this is an example message", no_crate::example, code = E0123)]
//~^ ERROR diagnostic slug must be the first argument
//~^ ERROR diagnostic message must be the first argument
struct SlugSpecifiedTwice {}
#[derive(Diagnostic)]
struct KindNotProvided {} //~ ERROR diagnostic slug not specified
struct KindNotProvided {} //~ ERROR diagnostic message not specified
#[derive(Diagnostic)]
#[diag(code = E0123)]
//~^ ERROR diagnostic slug not specified
//~^ ERROR diagnostic message not specified
struct SlugNotProvided {}
#[derive(Diagnostic)]
@ -467,7 +467,15 @@ struct BoolField {
#[diag("this is an example message", code = E0123)]
struct LabelWithTrailingPath {
#[label("with a label", foo)]
//~^ ERROR a diagnostic slug must be the first argument to the attribute
//~^ ERROR derive(Diagnostic): no nested attribute expected here
span: Span,
}
#[derive(Diagnostic)]
#[diag("this is an example message", code = E0123)]
struct LabelWithTrailingMessage {
#[label("with a label", "and another one?")]
//~^ ERROR derive(Diagnostic): a diagnostic message must be the first argument to the attribute
span: Span,
}
@ -516,28 +524,28 @@ struct ErrorWithWarn {
#[derive(Diagnostic)]
#[error("this is an example message", code = E0123)]
//~^ ERROR `#[error(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR diagnostic message not specified
//~| ERROR cannot find attribute `error` in this scope
struct ErrorAttribute {}
#[derive(Diagnostic)]
#[warn_("this is an example message", code = E0123)]
//~^ ERROR `#[warn_(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR diagnostic message not specified
//~| ERROR cannot find attribute `warn_` in this scope
struct WarnAttribute {}
#[derive(Diagnostic)]
#[lint("this is an example message", code = E0123)]
//~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR diagnostic message not specified
//~| ERROR cannot find attribute `lint` in this scope
struct LintAttributeOnSessionDiag {}
#[derive(LintDiagnostic)]
#[lint("this is an example message", code = E0123)]
//~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR diagnostic message not specified
//~| ERROR cannot find attribute `lint` in this scope
struct LintAttributeOnLintDiag {}

View file

@ -4,21 +4,21 @@ error: derive(Diagnostic): unsupported type attribute for diagnostic derive enum
LL | #[diag("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:47:5
|
LL | Foo,
| ^^^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:49:5
|
LL | Bar,
| ^^^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: expected parentheses: #[diag(...)]
--> $DIR/diagnostic-derive-inline.rs:55:8
@ -32,45 +32,45 @@ error: derive(Diagnostic): `#[nonsense(...)]` is not a valid attribute
LL | #[nonsense("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:60:1
|
LL | #[nonsense("this is an example message", code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:67:1
|
LL | #[diag(code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:72:1
|
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:77:1
|
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:82:1
|
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): unknown argument
--> $DIR/diagnostic-derive-inline.rs:87:52
@ -78,7 +78,7 @@ error: derive(Diagnostic): unknown argument
LL | #[diag("this is an example message", code = E0123, slug = "foo")]
| ^^^^
|
= note: only the `code` parameter is valid after the slug
= note: only the `code` parameter is valid after the message
error: derive(Diagnostic): `#[suggestion = ...]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:94:5
@ -110,27 +110,27 @@ note: previously specified here
LL | #[diag("this is an example message", code = E0123, code = E0456)]
| ^^^^
error: derive(Diagnostic): diagnostic slug must be the first argument
error: derive(Diagnostic): diagnostic message must be the first argument
--> $DIR/diagnostic-derive-inline.rs:111:38
|
LL | #[diag("this is an example message", no_crate::example, code = E0123)]
| ^^^^^^^^
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:116:1
|
LL | struct KindNotProvided {}
| ^^^^^^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): diagnostic slug not specified
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:119:1
|
LL | #[diag(code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/diagnostic-derive-inline.rs:130:5
@ -276,26 +276,32 @@ error: derive(Diagnostic): the `#[help(...)]` attribute can only be applied to f
LL | #[help("with a help")]
| ^
error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
error: derive(Diagnostic): no nested attribute expected here
--> $DIR/diagnostic-derive-inline.rs:469:29
|
LL | #[label("with a label", foo)]
| ^^^
error: derive(Diagnostic): no nested attribute expected here
error: derive(Diagnostic): a diagnostic message must be the first argument to the attribute
--> $DIR/diagnostic-derive-inline.rs:477:29
|
LL | #[label("with a label", "and another one?")]
| ^^^^^^^^^^^^^^^^^^
error: derive(Diagnostic): no nested attribute expected here
--> $DIR/diagnostic-derive-inline.rs:485:29
|
LL | #[label("with a label", foo = "...")]
| ^^^
error: derive(Diagnostic): no nested attribute expected here
--> $DIR/diagnostic-derive-inline.rs:485:29
--> $DIR/diagnostic-derive-inline.rs:493:29
|
LL | #[label("with a label", foo("..."))]
| ^^^
error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:497:5
--> $DIR/diagnostic-derive-inline.rs:505:5
|
LL | #[primary_span]
| ^
@ -303,75 +309,75 @@ LL | #[primary_span]
= help: the `primary_span` field attribute is not valid for lint diagnostics
error: derive(Diagnostic): `#[error(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:517:1
--> $DIR/diagnostic-derive-inline.rs:525:1
|
LL | #[error("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
--> $DIR/diagnostic-derive-inline.rs:517:1
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:525:1
|
LL | #[error("this is an example message", code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:524:1
--> $DIR/diagnostic-derive-inline.rs:532:1
|
LL | #[warn_("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
--> $DIR/diagnostic-derive-inline.rs:524:1
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:532:1
|
LL | #[warn_("this is an example message", code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:531:1
--> $DIR/diagnostic-derive-inline.rs:539:1
|
LL | #[lint("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
--> $DIR/diagnostic-derive-inline.rs:531:1
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:539:1
|
LL | #[lint("this is an example message", code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:538:1
--> $DIR/diagnostic-derive-inline.rs:546:1
|
LL | #[lint("this is an example message", code = E0123)]
| ^
error: derive(Diagnostic): diagnostic slug not specified
--> $DIR/diagnostic-derive-inline.rs:538:1
error: derive(Diagnostic): diagnostic message not specified
--> $DIR/diagnostic-derive-inline.rs:546:1
|
LL | #[lint("this is an example message", code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
= help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
error: derive(Diagnostic): attribute specified multiple times
--> $DIR/diagnostic-derive-inline.rs:547:53
--> $DIR/diagnostic-derive-inline.rs:555:53
|
LL | #[suggestion("with a suggestion", code = "...", code = ",,,")]
| ^^^^
|
note: previously specified here
--> $DIR/diagnostic-derive-inline.rs:547:39
--> $DIR/diagnostic-derive-inline.rs:555:39
|
LL | #[suggestion("with a suggestion", code = "...", code = ",,,")]
| ^^^^
error: derive(Diagnostic): wrong types for suggestion
--> $DIR/diagnostic-derive-inline.rs:556:24
--> $DIR/diagnostic-derive-inline.rs:564:24
|
LL | suggestion: (Span, usize),
| ^^^^^
@ -379,7 +385,7 @@ LL | suggestion: (Span, usize),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: derive(Diagnostic): wrong types for suggestion
--> $DIR/diagnostic-derive-inline.rs:564:17
--> $DIR/diagnostic-derive-inline.rs:572:17
|
LL | suggestion: (Span,),
| ^^^^^^^
@ -387,13 +393,13 @@ LL | suggestion: (Span,),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: derive(Diagnostic): suggestion without `code = "..."`
--> $DIR/diagnostic-derive-inline.rs:571:5
--> $DIR/diagnostic-derive-inline.rs:579:5
|
LL | #[suggestion("with a suggestion")]
| ^
error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:578:1
--> $DIR/diagnostic-derive-inline.rs:586:1
|
LL | #[multipart_suggestion("with a suggestion")]
| ^
@ -401,7 +407,7 @@ LL | #[multipart_suggestion("with a suggestion")]
= help: consider creating a `Subdiagnostic` instead
error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:581:1
--> $DIR/diagnostic-derive-inline.rs:589:1
|
LL | #[multipart_suggestion()]
| ^
@ -409,7 +415,7 @@ LL | #[multipart_suggestion()]
= help: consider creating a `Subdiagnostic` instead
error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:585:5
--> $DIR/diagnostic-derive-inline.rs:593:5
|
LL | #[multipart_suggestion("with a suggestion")]
| ^
@ -417,7 +423,7 @@ LL | #[multipart_suggestion("with a suggestion")]
= help: consider creating a `Subdiagnostic` instead
error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:593:1
--> $DIR/diagnostic-derive-inline.rs:601:1
|
LL | #[suggestion("with a suggestion", code = "...")]
| ^
@ -425,41 +431,35 @@ LL | #[suggestion("with a suggestion", code = "...")]
= help: `#[label]` and `#[suggestion]` can only be applied to fields
error: derive(Diagnostic): `#[label]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:602:1
--> $DIR/diagnostic-derive-inline.rs:610:1
|
LL | #[label]
| ^
|
= help: `#[label]` and `#[suggestion]` can only be applied to fields
= help: subdiagnostic message is missing
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:636:5
--> $DIR/diagnostic-derive-inline.rs:644:5
|
LL | #[subdiagnostic(bad)]
| ^
error: derive(Diagnostic): `#[subdiagnostic = ...]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:644:5
--> $DIR/diagnostic-derive-inline.rs:652:5
|
LL | #[subdiagnostic = "bad"]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:652:5
--> $DIR/diagnostic-derive-inline.rs:660:5
|
LL | #[subdiagnostic(bad, bad)]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:660:5
|
LL | #[subdiagnostic("bad")]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:668:5
|
LL | #[subdiagnostic(eager)]
LL | #[subdiagnostic("bad")]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
@ -469,37 +469,43 @@ LL | #[subdiagnostic(eager)]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:697:5
--> $DIR/diagnostic-derive-inline.rs:684:5
|
LL | #[subdiagnostic(eager)]
| ^
error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:705:5
|
LL | #[subdiagnostic(eager)]
| ^
error: derive(Diagnostic): expected at least one string literal for `code(...)`
--> $DIR/diagnostic-derive-inline.rs:728:44
--> $DIR/diagnostic-derive-inline.rs:736:44
|
LL | #[suggestion("with a suggestion", code())]
| ^
error: derive(Diagnostic): `code(...)` must contain only string literals
--> $DIR/diagnostic-derive-inline.rs:736:44
--> $DIR/diagnostic-derive-inline.rs:744:44
|
LL | #[suggestion("with a suggestion", code(foo))]
| ^^^
error: unexpected token, expected `)`
--> $DIR/diagnostic-derive-inline.rs:736:44
--> $DIR/diagnostic-derive-inline.rs:744:44
|
LL | #[suggestion("with a suggestion", code(foo))]
| ^^^
error: expected string literal
--> $DIR/diagnostic-derive-inline.rs:745:46
--> $DIR/diagnostic-derive-inline.rs:753:46
|
LL | #[suggestion("with a suggestion", code = 3)]
| ^
error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive-inline.rs:760:5
--> $DIR/diagnostic-derive-inline.rs:768:5
|
LL | #[suggestion("with a suggestion", code = "")]
| ^
@ -509,7 +515,7 @@ LL | #[suggestion("with a suggestion", code = "")]
= help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
error: derive(Diagnostic): Variable `nosub` not found in diagnostic
--> $DIR/diagnostic-derive-inline.rs:772:8
--> $DIR/diagnostic-derive-inline.rs:780:8
|
LL | #[diag("does not exist: {$nosub}")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -529,7 +535,7 @@ LL | #[nonsense]
| ^^^^^^^^
error: cannot find attribute `error` in this scope
--> $DIR/diagnostic-derive-inline.rs:517:3
--> $DIR/diagnostic-derive-inline.rs:525:3
|
LL | #[error("this is an example message", code = E0123)]
| ^^^^^
@ -541,7 +547,7 @@ LL | struct ErrorAttribute {}
|
error: cannot find attribute `warn_` in this scope
--> $DIR/diagnostic-derive-inline.rs:524:3
--> $DIR/diagnostic-derive-inline.rs:532:3
|
LL | #[warn_("this is an example message", code = E0123)]
| ^^^^^
@ -553,7 +559,7 @@ LL + #[warn("this is an example message", code = E0123)]
|
error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive-inline.rs:531:3
--> $DIR/diagnostic-derive-inline.rs:539:3
|
LL | #[lint("this is an example message", code = E0123)]
| ^^^^
@ -565,7 +571,7 @@ LL + #[link("this is an example message", code = E0123)]
|
error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive-inline.rs:538:3
--> $DIR/diagnostic-derive-inline.rs:546:3
|
LL | #[lint("this is an example message", code = E0123)]
| ^^^^
@ -577,7 +583,7 @@ LL + #[link("this is an example message", code = E0123)]
|
error: cannot find attribute `multipart_suggestion` in this scope
--> $DIR/diagnostic-derive-inline.rs:578:3
--> $DIR/diagnostic-derive-inline.rs:586:3
|
LL | #[multipart_suggestion("with a suggestion")]
| ^^^^^^^^^^^^^^^^^^^^
@ -589,7 +595,7 @@ LL | struct MultipartSuggestion {
|
error: cannot find attribute `multipart_suggestion` in this scope
--> $DIR/diagnostic-derive-inline.rs:581:3
--> $DIR/diagnostic-derive-inline.rs:589:3
|
LL | #[multipart_suggestion()]
| ^^^^^^^^^^^^^^^^^^^^
@ -601,7 +607,7 @@ LL | struct MultipartSuggestion {
|
error: cannot find attribute `multipart_suggestion` in this scope
--> $DIR/diagnostic-derive-inline.rs:585:7
--> $DIR/diagnostic-derive-inline.rs:593:7
|
LL | #[multipart_suggestion("with a suggestion")]
| ^^^^^^^^^^^^^^^^^^^^
@ -630,6 +636,6 @@ note: required by a bound in `Diag::<'a, G>::arg`
= note: in this macro invocation
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 80 previous errors
error: aborting due to 81 previous errors
For more information about this error, try `rustc --explain E0277`.

View file

@ -54,7 +54,7 @@ struct C {
#[derive(Subdiagnostic)]
#[label]
//~^ ERROR diagnostic slug must be first argument
//~^ ERROR diagnostic message must be first argument
struct D {
#[primary_span]
span: Span,
@ -83,7 +83,7 @@ struct F {
#[derive(Subdiagnostic)]
#[label(bug = "...")]
//~^ ERROR no nested attribute expected here
//~| ERROR diagnostic slug must be first argument
//~| ERROR diagnostic message must be first argument
struct G {
#[primary_span]
span: Span,
@ -93,7 +93,7 @@ struct G {
#[derive(Subdiagnostic)]
#[label(slug = 4)]
//~^ ERROR no nested attribute expected here
//~| ERROR diagnostic slug must be first argument
//~| ERROR diagnostic message must be first argument
struct J {
#[primary_span]
span: Span,
@ -103,7 +103,7 @@ struct J {
#[derive(Subdiagnostic)]
#[label(slug("..."))]
//~^ ERROR no nested attribute expected here
//~| ERROR diagnostic slug must be first argument
//~| ERROR diagnostic message must be first argument
struct K {
#[primary_span]
span: Span,
@ -112,7 +112,7 @@ struct K {
#[derive(Subdiagnostic)]
#[label()]
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
//~^ ERROR diagnostic message must be first argument of a `#[label(...)]` attribute
struct M {
#[primary_span]
span: Span,
@ -201,7 +201,7 @@ enum T {
#[derive(Subdiagnostic)]
enum U {
#[label(code = "...")]
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
//~^ ERROR diagnostic message must be first argument of a `#[label(...)]` attribute
//~| ERROR no nested attribute expected here
A {
#[primary_span]
@ -303,7 +303,7 @@ struct AD {
#[derive(Subdiagnostic)]
#[label("example message", no_crate::example)]
//~^ ERROR a diagnostic slug must be the first argument to the attribute
//~^ ERROR expected this path to be an identifier
struct AE {
#[primary_span]
span: Span,
@ -771,7 +771,7 @@ struct SuggestionStyleInvalid2 {
#[derive(Subdiagnostic)]
#[suggestion("example message", code = "", style)]
//~^ ERROR a diagnostic slug must be the first argument to the attribute
//~^ ERROR expected `=`
struct SuggestionStyleInvalid3 {
#[primary_span]
sub: Span,

View file

@ -4,7 +4,7 @@ error: derive(Diagnostic): label without `#[primary_span]` field
LL | #[label("example message")]
| ^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:56:1
|
LL | #[label]
@ -28,7 +28,7 @@ error: derive(Diagnostic): no nested attribute expected here
LL | #[label(bug = "...")]
| ^^^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:84:1
|
LL | #[label(bug = "...")]
@ -40,7 +40,7 @@ error: derive(Diagnostic): no nested attribute expected here
LL | #[label(slug = 4)]
| ^^^^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:94:1
|
LL | #[label(slug = 4)]
@ -52,13 +52,13 @@ error: derive(Diagnostic): no nested attribute expected here
LL | #[label(slug("..."))]
| ^^^^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:104:1
|
LL | #[label(slug("..."))]
| ^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:114:1
|
LL | #[label()]
@ -112,7 +112,7 @@ error: derive(Diagnostic): no nested attribute expected here
LL | #[label(code = "...")]
| ^^^^
error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive-inline.rs:203:5
|
LL | #[label(code = "...")]
@ -168,11 +168,11 @@ LL | | b: u64,
LL | | }
| |_^
error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
error: expected this path to be an identifier
--> $DIR/subdiagnostic-derive-inline.rs:305:28
|
LL | #[label("example message", no_crate::example)]
| ^^^^^^^^
| ^^^^^^^^^^^^^^^^^
error: derive(Diagnostic): attribute specified multiple times
--> $DIR/subdiagnostic-derive-inline.rs:318:5
@ -464,11 +464,11 @@ error: expected string literal
LL | #[suggestion("example message", code = "", style = 42)]
| ^^
error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
--> $DIR/subdiagnostic-derive-inline.rs:773:44
error: expected `=`
--> $DIR/subdiagnostic-derive-inline.rs:773:49
|
LL | #[suggestion("example message", code = "", style)]
| ^^^^^
| ^
error: expected `=`
--> $DIR/subdiagnostic-derive-inline.rs:781:49