mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rename LintContext::opt_span_diag_lint method into opt_span_lint
This commit is contained in:
@@ -516,7 +516,7 @@ pub trait LintContext {
|
||||
///
|
||||
/// [`emit_lint_base`]: rustc_middle::lint::emit_lint_base#decorate-signature
|
||||
#[track_caller]
|
||||
fn opt_span_diag_lint<S: Into<MultiSpan>>(
|
||||
fn opt_span_lint<S: Into<MultiSpan>>(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: Option<S>,
|
||||
@@ -532,7 +532,7 @@ fn emit_span_lint<S: Into<MultiSpan>>(
|
||||
span: S,
|
||||
decorator: impl for<'a> Diagnostic<'a, ()>,
|
||||
) {
|
||||
self.opt_span_diag_lint(lint, Some(span), decorator);
|
||||
self.opt_span_lint(lint, Some(span), decorator);
|
||||
}
|
||||
|
||||
/// This returns the lint level for the given lint at the current location.
|
||||
@@ -588,7 +588,7 @@ fn sess(&self) -> &Session {
|
||||
self.tcx.sess
|
||||
}
|
||||
|
||||
fn opt_span_diag_lint<S: Into<MultiSpan>>(
|
||||
fn opt_span_lint<S: Into<MultiSpan>>(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: Option<S>,
|
||||
@@ -613,13 +613,13 @@ fn sess(&self) -> &Session {
|
||||
self.builder.sess()
|
||||
}
|
||||
|
||||
fn opt_span_diag_lint<S: Into<MultiSpan>>(
|
||||
fn opt_span_lint<S: Into<MultiSpan>>(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: Option<S>,
|
||||
decorator: impl for<'a> Diagnostic<'a, ()>,
|
||||
) {
|
||||
self.builder.opt_span_diag_lint(lint, span.map(|s| s.into()), decorator)
|
||||
self.builder.opt_span_lint(lint, span.map(|s| s.into()), decorator)
|
||||
}
|
||||
|
||||
fn get_lint_level(&self, lint: &'static Lint) -> LevelAndSource {
|
||||
|
||||
@@ -39,7 +39,7 @@ fn check_id(&mut self, id: ast::NodeId) {
|
||||
let BufferedEarlyLint { span, node_id: _, lint_id, diagnostic } = early_lint;
|
||||
match diagnostic {
|
||||
DecorateDiagCompat::Builtin(b) => {
|
||||
self.context.opt_span_diag_lint(
|
||||
self.context.opt_span_lint(
|
||||
lint_id.lint,
|
||||
span,
|
||||
DecorateBuiltinLint {
|
||||
@@ -50,7 +50,7 @@ fn check_id(&mut self, id: ast::NodeId) {
|
||||
);
|
||||
}
|
||||
DecorateDiagCompat::Dynamic(d) => {
|
||||
self.context.opt_span_diag_lint(lint_id.lint, span, d);
|
||||
self.context.opt_span_lint(lint_id.lint, span, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1001,7 +1001,7 @@ pub fn lint_level(&self, lint: &'static Lint) -> LevelAndSource {
|
||||
/// Used to emit a lint-related diagnostic based on the current state of
|
||||
/// this lint context.
|
||||
#[track_caller]
|
||||
pub(crate) fn opt_span_diag_lint(
|
||||
pub(crate) fn opt_span_lint(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: Option<MultiSpan>,
|
||||
|
||||
Reference in New Issue
Block a user