Skip to content

Commit

Permalink
Add missing code="" attributes to suggestion subdiagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiretza committed Sep 22, 2022
1 parent 57679fb commit ae56d2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ pub enum BadTypePlusSub {
#[diag(parser::maybe_recover_from_bad_qpath_stage_2)]
struct BadQPathStage2 {
#[primary_span]
#[suggestion(applicability = "maybe-incorrect")]
#[suggestion(code = "", applicability = "maybe-incorrect")]
span: Span,
ty: String,
}
Expand All @@ -298,7 +298,7 @@ struct BadQPathStage2 {
#[diag(parser::incorrect_semicolon)]
struct IncorrectSemicolon<'a> {
#[primary_span]
#[suggestion_short(applicability = "machine-applicable")]
#[suggestion_short(code = "", applicability = "machine-applicable")]
span: Span,
#[help]
opt_help: Option<()>,
Expand All @@ -309,7 +309,7 @@ struct IncorrectSemicolon<'a> {
#[diag(parser::incorrect_use_of_await)]
struct IncorrectUseOfAwait {
#[primary_span]
#[suggestion(parser::parentheses_suggestion, applicability = "machine-applicable")]
#[suggestion(parser::parentheses_suggestion, code = "", applicability = "machine-applicable")]
span: Span,
}

Expand All @@ -329,7 +329,7 @@ struct IncorrectAwait {
struct InInTypo {
#[primary_span]
span: Span,
#[suggestion(applicability = "machine-applicable")]
#[suggestion(code = "", applicability = "machine-applicable")]
sugg_span: Span,
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ pub struct LinkSection {
pub struct NoMangleForeign {
#[label]
pub span: Span,
#[suggestion(applicability = "machine-applicable")]
#[suggestion(code = "", applicability = "machine-applicable")]
pub attr_span: Span,
pub foreign_item_kind: &'static str,
}
Expand Down Expand Up @@ -596,7 +596,7 @@ pub enum UnusedNote {
#[derive(LintDiagnostic)]
#[diag(passes::unused)]
pub struct Unused {
#[suggestion(applicability = "machine-applicable")]
#[suggestion(code = "", applicability = "machine-applicable")]
pub attr_span: Span,
#[subdiagnostic]
pub note: UnusedNote,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ struct WrongKindOfAnnotation {
struct OptionsInErrors {
#[label(typeck::label)]
label: Option<Span>,
#[suggestion(typeck::suggestion)]
#[suggestion(typeck::suggestion, code = "...")]
opt_sugg: Option<(Span, Applicability)>,
}

Expand Down

0 comments on commit ae56d2a

Please sign in to comment.