Skip to content

Commit

Permalink
Rename LintLevelsBuilder::struct_lint as `LintLevelsBuilder::opt_sp…
Browse files Browse the repository at this point in the history
…an_lint`.
  • Loading branch information
nnethercote committed Jan 22, 2024
1 parent 1881bfa commit 749afe2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ impl LintContext for EarlyContext<'_> {
msg: impl Into<DiagnosticMessage>,
decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>),
) {
self.builder.struct_lint(lint, span.map(|s| s.into()), msg, decorate)
self.builder.opt_span_lint(lint, span.map(|s| s.into()), msg, decorate)
}

fn get_lint_level(&self, lint: &'static Lint) -> Level {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
#[rustc_lint_diagnostics]
#[track_caller]
pub(crate) fn struct_lint(
pub(crate) fn opt_span_lint(
&self,
lint: &'static Lint,
span: Option<MultiSpan>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ fn report_conflicting_impls<'tcx>(
let impl_span = tcx.def_span(impl_def_id);

// Work to be done after we've built the DiagnosticBuilder. We have to define it
// now because the struct_lint methods don't return back the DiagnosticBuilder
// now because the lint emit methods don't return back the DiagnosticBuilder
// that's passed in.
fn decorate<'tcx>(
tcx: TyCtxt<'tcx>,
Expand Down

0 comments on commit 749afe2

Please sign in to comment.