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:
@@ -524,6 +524,20 @@ pub trait LintContext {
|
||||
});
|
||||
}
|
||||
|
||||
/// Emit a lint at `span` from a lazily-constructed lint struct (some type that implements
|
||||
/// `LintDiagnostic`, typically generated by `#[derive(LintDiagnostic)]`).
|
||||
fn emit_span_lint_lazy<S: Into<MultiSpan>, L: for<'a> LintDiagnostic<'a, ()>>(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: S,
|
||||
decorator: impl FnOnce() -> L,
|
||||
) {
|
||||
self.opt_span_lint(lint, Some(span), |lint| {
|
||||
let decorator = decorator();
|
||||
decorator.decorate_lint(lint);
|
||||
});
|
||||
}
|
||||
|
||||
/// Emit a lint at the appropriate level, with an associated span.
|
||||
///
|
||||
/// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature
|
||||
|
||||
Reference in New Issue
Block a user