Rollup merge of #142645 - Urgau:usage-non_upper_case_globals, r=fmease
Also emit suggestions for usages in the `non_upper_case_globals` lint This PR adds suggestions for all the usages of the renamed item in the warning of the `non_upper_case_globals` lint. Fixes https://github.com/rust-lang/rust/issues/124061
This commit is contained in:
@@ -1353,6 +1353,8 @@ pub(crate) struct NonUpperCaseGlobal<'a> {
|
||||
pub name: &'a str,
|
||||
#[subdiagnostic]
|
||||
pub sub: NonUpperCaseGlobalSub,
|
||||
#[subdiagnostic]
|
||||
pub usages: Vec<NonUpperCaseGlobalSubTool>,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
@@ -1362,14 +1364,29 @@ pub(crate) enum NonUpperCaseGlobalSub {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[suggestion(lint_suggestion, code = "{replace}", applicability = "maybe-incorrect")]
|
||||
#[suggestion(lint_suggestion, code = "{replace}")]
|
||||
Suggestion {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
#[applicability]
|
||||
applicability: Applicability,
|
||||
replace: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[suggestion(
|
||||
lint_suggestion,
|
||||
code = "{replace}",
|
||||
applicability = "machine-applicable",
|
||||
style = "tool-only"
|
||||
)]
|
||||
pub(crate) struct NonUpperCaseGlobalSubTool {
|
||||
#[primary_span]
|
||||
pub(crate) span: Span,
|
||||
pub(crate) replace: String,
|
||||
}
|
||||
|
||||
// noop_method_call.rs
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_noop_method_call)]
|
||||
|
||||
Reference in New Issue
Block a user