Skip to content

Commit cfdea76

Browse files
committed
Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint.
1 parent 681b9aa commit cfdea76

File tree

34 files changed

+56
-68
lines changed

34 files changed

+56
-68
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
563563
if codegen_fn_attrs.inline == InlineAttr::Always {
564564
if let (Some(no_sanitize_span), Some(inline_span)) = (no_sanitize_span, inline_span) {
565565
let hir_id = tcx.local_def_id_to_hir_id(did);
566-
tcx.struct_span_lint_hir(
566+
tcx.node_span_lint(
567567
lint::builtin::INLINE_NO_SANITIZE,
568568
hir_id,
569569
no_sanitize_span,

compiler/rustc_hir_analysis/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
656656
} else {
657657
let mut multispan = MultiSpan::from_span(span);
658658
multispan.push_span_label(span_late, note);
659-
tcx.struct_span_lint_hir(
659+
tcx.node_span_lint(
660660
LATE_BOUND_LIFETIME_ARGUMENTS,
661661
args.args[0].hir_id(),
662662
multispan,

compiler/rustc_hir_analysis/src/astconv/lint.rs

+12-18
Original file line numberDiff line numberDiff line change
@@ -240,24 +240,18 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
240240
diag.stash(self_ty.span, StashKey::TraitMissingMethod);
241241
} else {
242242
let msg = "trait objects without an explicit `dyn` are deprecated";
243-
tcx.struct_span_lint_hir(
244-
BARE_TRAIT_OBJECTS,
245-
self_ty.hir_id,
246-
self_ty.span,
247-
msg,
248-
|lint| {
249-
if self_ty.span.can_be_used_for_suggestions()
250-
&& !self.maybe_lint_impl_trait(self_ty, lint)
251-
{
252-
lint.multipart_suggestion_verbose(
253-
"use `dyn`",
254-
sugg,
255-
Applicability::MachineApplicable,
256-
);
257-
}
258-
self.maybe_lint_blanket_trait_impl(self_ty, lint);
259-
},
260-
);
243+
tcx.node_span_lint(BARE_TRAIT_OBJECTS, self_ty.hir_id, self_ty.span, msg, |lint| {
244+
if self_ty.span.can_be_used_for_suggestions()
245+
&& !self.maybe_lint_impl_trait(self_ty, lint)
246+
{
247+
lint.multipart_suggestion_verbose(
248+
"use `dyn`",
249+
sugg,
250+
Applicability::MachineApplicable,
251+
);
252+
}
253+
self.maybe_lint_blanket_trait_impl(self_ty, lint);
254+
});
261255
}
262256
}
263257
}

compiler/rustc_hir_analysis/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
13941394
let ty = self.projected_ty_from_poly_trait_ref(span, assoc_ty_did, assoc_segment, bound);
13951395

13961396
if let Some(variant_def_id) = variant_resolution {
1397-
tcx.struct_span_lint_hir(
1397+
tcx.node_span_lint(
13981398
AMBIGUOUS_ASSOCIATED_ITEMS,
13991399
hir_ref_id,
14001400
span,

compiler/rustc_hir_analysis/src/check/check.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: Abi) {
4646
.emit();
4747
}
4848
None => {
49-
tcx.struct_span_lint_hir(
49+
tcx.node_span_lint(
5050
UNSUPPORTED_CALLING_CONVENTIONS,
5151
hir_id,
5252
span,
@@ -183,7 +183,7 @@ fn check_static_inhabited(tcx: TyCtxt<'_>, def_id: LocalDefId) {
183183
}
184184
};
185185
if layout.abi.is_uninhabited() {
186-
tcx.struct_span_lint_hir(
186+
tcx.node_span_lint(
187187
UNINHABITED_STATIC,
188188
tcx.local_def_id_to_hir_id(def_id),
189189
span,
@@ -1079,7 +1079,7 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
10791079
// If there are any non-trivial fields, then there can be no non-exhaustive 1-zsts.
10801080
// Otherwise, it's only an issue if there's >1 non-exhaustive 1-zst.
10811081
if non_trivial_count > 0 || prev_non_exhaustive_1zst {
1082-
tcx.struct_span_lint_hir(
1082+
tcx.node_span_lint(
10831083
REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS,
10841084
tcx.local_def_id_to_hir_id(adt.did().expect_local()),
10851085
span,

compiler/rustc_hir_analysis/src/check/intrinsicck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
270270
if !spans.is_empty() {
271271
let (default_modifier, default_result) =
272272
reg_class.default_modifier(asm_arch).unwrap();
273-
self.tcx.struct_span_lint_hir(
273+
self.tcx.node_span_lint(
274274
lint::builtin::ASM_SUB_REGISTER,
275275
expr.hir_id,
276276
spans,

compiler/rustc_hir_analysis/src/check_unused.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
4040
} else {
4141
"unused import".to_owned()
4242
};
43-
tcx.struct_span_lint_hir(
44-
lint::builtin::UNUSED_IMPORTS,
45-
item.hir_id(),
46-
path.span,
47-
msg,
48-
|_| {},
49-
);
43+
tcx.node_span_lint(lint::builtin::UNUSED_IMPORTS, item.hir_id(), path.span, msg, |_| {});
5044
}
5145
}

compiler/rustc_hir_analysis/src/coherence/orphan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ fn lint_auto_trait_impl<'tcx>(
495495
return;
496496
}
497497

498-
tcx.struct_span_lint_hir(
498+
tcx.node_span_lint(
499499
lint::builtin::SUSPICIOUS_AUTO_TRAIT_IMPLS,
500500
tcx.local_def_id_to_hir_id(impl_def_id),
501501
tcx.def_span(impl_def_id),

compiler/rustc_hir_analysis/src/collect/generics_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
274274
Defaults::FutureCompatDisallowed
275275
if tcx.features().default_type_parameter_fallback => {}
276276
Defaults::FutureCompatDisallowed => {
277-
tcx.struct_span_lint_hir(
277+
tcx.node_span_lint(
278278
lint::builtin::INVALID_TYPE_PARAM_DEFAULT,
279279
param.hir_id,
280280
param.span,

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
912912
continue;
913913
}
914914
self.insert_lifetime(lt, ResolvedArg::StaticLifetime);
915-
self.tcx.struct_span_lint_hir(
915+
self.tcx.node_span_lint(
916916
lint::builtin::UNUSED_LIFETIMES,
917917
lifetime.hir_id,
918918
lifetime.ident.span,

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
6262
debug!("warn_if_unreachable: id={:?} span={:?} kind={}", id, span, kind);
6363

6464
let msg = format!("unreachable {kind}");
65-
self.tcx().struct_span_lint_hir(
65+
self.tcx().node_span_lint(
6666
lint::builtin::UNREACHABLE_CODE,
6767
id,
6868
span,

compiler/rustc_hir_typeck/src/method/prelude2021.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
7777

7878
// Inherent impls only require not relying on autoref and autoderef in order to
7979
// ensure that the trait implementation won't be used
80-
self.tcx.struct_span_lint_hir(
80+
self.tcx.node_span_lint(
8181
prelude_or_array_lint,
8282
self_expr.hir_id,
8383
self_expr.span,
@@ -127,7 +127,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
127127
} else {
128128
// trait implementations require full disambiguation to not clash with the new prelude
129129
// additions (i.e. convert from dot-call to fully-qualified call)
130-
self.tcx.struct_span_lint_hir(
130+
self.tcx.node_span_lint(
131131
prelude_or_array_lint,
132132
call_expr.hir_id,
133133
call_expr.span,
@@ -238,7 +238,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
238238
return;
239239
}
240240

241-
self.tcx.struct_span_lint_hir(
241+
self.tcx.node_span_lint(
242242
RUST_2021_PRELUDE_COLLISIONS,
243243
expr_id,
244244
span,

compiler/rustc_hir_typeck/src/method/probe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
440440
if self.tcx.sess.at_least_rust_2018() {
441441
self.dcx().emit_err(MethodCallOnUnknownRawPointee { span });
442442
} else {
443-
self.tcx.struct_span_lint_hir(
443+
self.tcx.node_span_lint(
444444
lint::builtin::TYVAR_BEHIND_RAW_POINTER,
445445
scope_expr_id,
446446
span,
@@ -1380,7 +1380,7 @@ impl<'tcx> Pick<'tcx> {
13801380
return;
13811381
}
13821382
let def_kind = self.item.kind.as_def_kind();
1383-
tcx.struct_span_lint_hir(
1383+
tcx.node_span_lint(
13841384
lint::builtin::UNSTABLE_NAME_COLLISIONS,
13851385
scope_expr_id,
13861386
span,

compiler/rustc_hir_typeck/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18401840
&unmentioned_fields.iter().map(|(_, i)| i).collect::<Vec<_>>(),
18411841
);
18421842

1843-
self.tcx.struct_span_lint_hir(NON_EXHAUSTIVE_OMITTED_PATTERNS, pat.hir_id, pat.span, "some fields are not explicitly listed", |lint| {
1843+
self.tcx.node_span_lint(NON_EXHAUSTIVE_OMITTED_PATTERNS, pat.hir_id, pat.span, "some fields are not explicitly listed", |lint| {
18441844
lint.span_label(pat.span, format!("field{} {} not listed", rustc_errors::pluralize!(unmentioned_fields.len()), joined_patterns));
18451845
lint.help(
18461846
"ensure that all fields are mentioned explicitly by adding the suggested fields",

compiler/rustc_hir_typeck/src/upvar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
754754

755755
let closure_hir_id = self.tcx.local_def_id_to_hir_id(closure_def_id);
756756
let closure_head_span = self.tcx.def_span(closure_def_id);
757-
self.tcx.struct_span_lint_hir(
757+
self.tcx.node_span_lint(
758758
lint::builtin::RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES,
759759
closure_hir_id,
760760
closure_head_span,

compiler/rustc_lint/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ impl<'tcx> LintContext for LateContext<'tcx> {
676676
let hir_id = self.last_node_with_lint_attrs;
677677

678678
match span {
679-
Some(s) => self.tcx.struct_span_lint_hir(lint, hir_id, s, msg, decorate),
679+
Some(s) => self.tcx.node_span_lint(lint, hir_id, s, msg, decorate),
680680
None => self.tcx.node_lint(lint, hir_id, msg, decorate),
681681
}
682682
}

compiler/rustc_middle/src/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub fn explain_lint_level_source(
248248
/// If you are looking to implement a lint, look for higher level functions,
249249
/// for example:
250250
/// - [`TyCtxt::emit_spanned_lint`]
251-
/// - [`TyCtxt::struct_span_lint_hir`]
251+
/// - [`TyCtxt::node_span_lint`]
252252
/// - [`TyCtxt::emit_lint`]
253253
/// - [`TyCtxt::node_lint`]
254254
/// - `LintContext::opt_span_lint`

compiler/rustc_middle/src/middle/stability.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn late_report_deprecation(
217217
return;
218218
}
219219
let method_span = method_span.unwrap_or(span);
220-
tcx.struct_span_lint_hir(lint, hir_id, method_span, message, |diag| {
220+
tcx.node_span_lint(lint, hir_id, method_span, message, |diag| {
221221
if let hir::Node::Expr(_) = tcx.hir_node(hir_id) {
222222
let kind = tcx.def_descr(def_id);
223223
deprecation_suggestion(diag, kind, suggestion, method_span);
@@ -585,7 +585,7 @@ impl<'tcx> TyCtxt<'tcx> {
585585
unmarked: impl FnOnce(Span, DefId),
586586
) -> bool {
587587
let soft_handler = |lint, span, msg: String| {
588-
self.struct_span_lint_hir(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, msg, |_| {})
588+
self.node_span_lint(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, msg, |_| {})
589589
};
590590
let eval_result =
591591
self.eval_stability_allow_unstable(def_id, id, span, method_span, allow_unstable);

compiler/rustc_middle/src/mir/interpret/queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'tcx> TyCtxt<'tcx> {
108108
let mir_body = self.mir_for_ctfe(instance.def_id());
109109
if mir_body.is_polymorphic {
110110
let Some(local_def_id) = ct.def.as_local() else { return };
111-
self.struct_span_lint_hir(
111+
self.node_span_lint(
112112
lint::builtin::CONST_EVALUATABLE_UNCHECKED,
113113
self.local_def_id_to_hir_id(local_def_id),
114114
self.def_span(ct.def),

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ impl<'tcx> TyCtxt<'tcx> {
20962096
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
20972097
#[rustc_lint_diagnostics]
20982098
#[track_caller]
2099-
pub fn struct_span_lint_hir(
2099+
pub fn node_span_lint(
21002100
self,
21012101
lint: &'static Lint,
21022102
hir_id: HirId,

compiler/rustc_trait_selection/src/traits/object_safety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn lint_object_unsafe_trait(
161161
) {
162162
// Using `CRATE_NODE_ID` is wrong, but it's hard to get a more precise id.
163163
// It's also hard to get a use site span, so we use the method definition span.
164-
tcx.struct_span_lint_hir(
164+
tcx.node_span_lint(
165165
WHERE_CLAUSES_OBJECT_SAFETY,
166166
hir::CRATE_HIR_ID,
167167
span,

compiler/rustc_trait_selection/src/traits/specialize/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ fn report_conflicting_impls<'tcx>(
462462
FutureCompatOverlapErrorKind::Issue33140 => ORDER_DEPENDENT_TRAIT_OBJECTS,
463463
FutureCompatOverlapErrorKind::LeakCheck => COHERENCE_LEAK_CHECK,
464464
};
465-
tcx.struct_span_lint_hir(
465+
tcx.node_span_lint(
466466
lint,
467467
tcx.local_def_id_to_hir_id(impl_def_id),
468468
impl_span,

src/librustdoc/html/markdown.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ impl<'tcx> ExtraInfo<'tcx> {
827827

828828
fn error_invalid_codeblock_attr(&self, msg: impl Into<DiagnosticMessage>) {
829829
if let Some(def_id) = self.def_id.as_local() {
830-
self.tcx.struct_span_lint_hir(
830+
self.tcx.node_span_lint(
831831
crate::lint::INVALID_CODEBLOCK_ATTRIBUTES,
832832
self.tcx.local_def_id_to_hir_id(def_id),
833833
self.sp,
@@ -843,7 +843,7 @@ impl<'tcx> ExtraInfo<'tcx> {
843843
f: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>),
844844
) {
845845
if let Some(def_id) = self.def_id.as_local() {
846-
self.tcx.struct_span_lint_hir(
846+
self.tcx.node_span_lint(
847847
crate::lint::INVALID_CODEBLOCK_ATTRIBUTES,
848848
self.tcx.local_def_id_to_hir_id(def_id),
849849
self.sp,

src/librustdoc/passes/check_doc_test_visibility.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub(crate) fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item
126126
if should_have_doc_example(cx, item) {
127127
debug!("reporting error for {item:?} (hir_id={hir_id:?})");
128128
let sp = item.attr_span(cx.tcx);
129-
cx.tcx.struct_span_lint_hir(
129+
cx.tcx.node_span_lint(
130130
crate::lint::MISSING_DOC_CODE_EXAMPLES,
131131
hir_id,
132132
sp,
@@ -137,7 +137,7 @@ pub(crate) fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item
137137
} else if tests.found_tests > 0
138138
&& !cx.cache.effective_visibilities.is_exported(cx.tcx, item.item_id.expect_def_id())
139139
{
140-
cx.tcx.struct_span_lint_hir(
140+
cx.tcx.node_span_lint(
141141
crate::lint::PRIVATE_DOC_TESTS,
142142
hir_id,
143143
item.attr_span(cx.tcx),

src/librustdoc/passes/collect_intra_doc_links.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ fn report_diagnostic(
17041704

17051705
let sp = item.attr_span(tcx);
17061706

1707-
tcx.struct_span_lint_hir(lint, hir_id, sp, msg, |lint| {
1707+
tcx.node_span_lint(lint, hir_id, sp, msg, |lint| {
17081708
let (span, link_range) = match link_range {
17091709
MarkdownLinkRange::Destination(md_range) => {
17101710
let mut md_range = md_range.clone();

src/librustdoc/passes/lint/bare_urls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(super) fn visit_item(cx: &DocContext<'_>, item: &Item) {
2424
let sp =
2525
source_span_for_markdown_range(cx.tcx, &dox, &range, &item.attrs.doc_strings)
2626
.unwrap_or_else(|| item.attr_span(cx.tcx));
27-
cx.tcx.struct_span_lint_hir(crate::lint::BARE_URLS, hir_id, sp, msg, |lint| {
27+
cx.tcx.node_span_lint(crate::lint::BARE_URLS, hir_id, sp, msg, |lint| {
2828
lint.note("bare URLs are not automatically turned into clickable links")
2929
.span_suggestion(
3030
sp,

src/librustdoc/passes/lint/check_code_block_syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn check_rust_syntax(
9999
// All points of divergence have been handled earlier so this can be
100100
// done the same way whether the span is precise or not.
101101
let hir_id = cx.tcx.local_def_id_to_hir_id(local_id);
102-
cx.tcx.struct_span_lint_hir(crate::lint::INVALID_RUST_CODEBLOCKS, hir_id, sp, msg, |lint| {
102+
cx.tcx.node_span_lint(crate::lint::INVALID_RUST_CODEBLOCKS, hir_id, sp, msg, |lint| {
103103
let explanation = if is_ignore {
104104
"`ignore` code blocks require valid Rust code for syntax highlighting; \
105105
mark blocks that do not contain Rust code as text"

src/librustdoc/passes/lint/html_tags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item) {
2525
Some(sp) => sp,
2626
None => item.attr_span(tcx),
2727
};
28-
tcx.struct_span_lint_hir(crate::lint::INVALID_HTML_TAGS, hir_id, sp, msg, |lint| {
28+
tcx.node_span_lint(crate::lint::INVALID_HTML_TAGS, hir_id, sp, msg, |lint| {
2929
use rustc_lint_defs::Applicability;
3030
// If a tag looks like `<this>`, it might actually be a generic.
3131
// We don't try to detect stuff `<like, this>` because that's not valid HTML,

src/librustdoc/passes/lint/redundant_explicit_links.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn check_inline_or_reference_unknown_redundancy(
176176
&item.attrs.doc_strings,
177177
)?;
178178

179-
cx.tcx.struct_span_lint_hir(crate::lint::REDUNDANT_EXPLICIT_LINKS, hir_id, explicit_span, "redundant explicit link target", |lint| {
179+
cx.tcx.node_span_lint(crate::lint::REDUNDANT_EXPLICIT_LINKS, hir_id, explicit_span, "redundant explicit link target", |lint| {
180180
lint.span_label(explicit_span, "explicit target is redundant")
181181
.span_label(display_span, "because label contains path that resolves to same destination")
182182
.note("when a link's destination is not specified,\nthe label is used to resolve intra-doc links")
@@ -226,7 +226,7 @@ fn check_reference_redundancy(
226226
&item.attrs.doc_strings,
227227
)?;
228228

229-
cx.tcx.struct_span_lint_hir(crate::lint::REDUNDANT_EXPLICIT_LINKS, hir_id, explicit_span, "redundant explicit link target", |lint| {
229+
cx.tcx.node_span_lint(crate::lint::REDUNDANT_EXPLICIT_LINKS, hir_id, explicit_span, "redundant explicit link target", |lint| {
230230
lint.span_label(explicit_span, "explicit target is redundant")
231231
.span_label(display_span, "because label contains path that resolves to same destination")
232232
.span_note(def_span, "referenced explicit link target defined here")

src/librustdoc/passes/lint/unescaped_backticks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item) {
5656
)
5757
.unwrap_or_else(|| item.attr_span(tcx));
5858

59-
tcx.struct_span_lint_hir(crate::lint::UNESCAPED_BACKTICKS, hir_id, span, "unescaped backtick", |lint| {
59+
tcx.node_span_lint(crate::lint::UNESCAPED_BACKTICKS, hir_id, span, "unescaped backtick", |lint| {
6060
let mut help_emitted = false;
6161

6262
match element.prev_code_guess {

src/tools/clippy/clippy.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ avoid-breaking-exported-api = false
33
# use the various `span_lint_*` methods instead, which also add a link to the docs
44
disallowed-methods = [
55
"rustc_lint::context::LintContext::span_lint",
6-
"rustc_middle::ty::context::TyCtxt::struct_span_lint_hir"
6+
"rustc_middle::ty::context::TyCtxt::node_span_lint"
77
]

0 commit comments

Comments
 (0)