Skip to content

Commit 3c61714

Browse files
Rollup merge of rust-lang#152121 - JonathanBrouwer:convert_builtin_macros, r=lqd
Convert to inline diagnostics in `rustc_builtin_macros` For rust-lang#151366 r? @jdonszelmann
2 parents 4d535f5 + d40e60f commit 3c61714

File tree

8 files changed

+298
-533
lines changed

8 files changed

+298
-533
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,7 +3599,6 @@ dependencies = [
35993599
"rustc_errors",
36003600
"rustc_expand",
36013601
"rustc_feature",
3602-
"rustc_fluent_macro",
36033602
"rustc_hir",
36043603
"rustc_index",
36053604
"rustc_lexer",
@@ -3773,7 +3772,6 @@ dependencies = [
37733772
"rustc_ast",
37743773
"rustc_ast_pretty",
37753774
"rustc_borrowck",
3776-
"rustc_builtin_macros",
37773775
"rustc_codegen_ssa",
37783776
"rustc_const_eval",
37793777
"rustc_data_structures",

compiler/rustc_builtin_macros/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ rustc_data_structures = { path = "../rustc_data_structures" }
1515
rustc_errors = { path = "../rustc_errors" }
1616
rustc_expand = { path = "../rustc_expand" }
1717
rustc_feature = { path = "../rustc_feature" }
18-
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1918
rustc_hir = { path = "../rustc_hir" }
2019
rustc_index = { path = "../rustc_index" }
2120
rustc_lexer = { path = "../rustc_lexer" }

compiler/rustc_builtin_macros/messages.ftl

Lines changed: 0 additions & 320 deletions
This file was deleted.

compiler/rustc_builtin_macros/src/deriving/coerce_pointee.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,44 +463,44 @@ impl<'a, 'b> rustc_ast::visit::Visitor<'a> for AlwaysErrorOnGenericParam<'a, 'b>
463463
}
464464

465465
#[derive(Diagnostic)]
466-
#[diag(builtin_macros_coerce_pointee_requires_transparent, code = E0802)]
466+
#[diag("`CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]`", code = E0802)]
467467
struct RequireTransparent {
468468
#[primary_span]
469469
span: Span,
470470
}
471471

472472
#[derive(Diagnostic)]
473-
#[diag(builtin_macros_coerce_pointee_requires_one_field, code = E0802)]
473+
#[diag("`CoercePointee` can only be derived on `struct`s with at least one field", code = E0802)]
474474
struct RequireOneField {
475475
#[primary_span]
476476
span: Span,
477477
}
478478

479479
#[derive(Diagnostic)]
480-
#[diag(builtin_macros_coerce_pointee_requires_one_generic, code = E0802)]
480+
#[diag("`CoercePointee` can only be derived on `struct`s that are generic over at least one type", code = E0802)]
481481
struct RequireOneGeneric {
482482
#[primary_span]
483483
span: Span,
484484
}
485485

486486
#[derive(Diagnostic)]
487-
#[diag(builtin_macros_coerce_pointee_requires_one_pointee, code = E0802)]
487+
#[diag("exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits", code = E0802)]
488488
struct RequireOnePointee {
489489
#[primary_span]
490490
span: Span,
491491
}
492492

493493
#[derive(Diagnostic)]
494-
#[diag(builtin_macros_coerce_pointee_too_many_pointees, code = E0802)]
494+
#[diag("only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits", code = E0802)]
495495
struct TooManyPointees {
496496
#[primary_span]
497497
one: Span,
498-
#[label]
498+
#[label("here another type parameter is marked as `#[pointee]`")]
499499
another: Span,
500500
}
501501

502502
#[derive(Diagnostic)]
503-
#[diag(builtin_macros_coerce_pointee_requires_maybe_sized, code = E0802)]
503+
#[diag("`derive(CoercePointee)` requires `{$name}` to be marked `?Sized`", code = E0802)]
504504
struct RequiresMaybeSized {
505505
#[primary_span]
506506
span: Span,

0 commit comments

Comments
 (0)