about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/astconv/lint.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-16 16:14:33 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-23 08:09:01 +1100
commitcfdea760f5ca36fdd04c8f18f3dac0bef66055cc (patch)
tree4daba05dce1c25b379bec55475f47998984e910e /compiler/rustc_hir_analysis/src/astconv/lint.rs
parent681b9aa363d350a4b8ecb9eedc025baa6e0bf9ca (diff)
downloadrust-cfdea760f5ca36fdd04c8f18f3dac0bef66055cc.tar.gz
rust-cfdea760f5ca36fdd04c8f18f3dac0bef66055cc.zip
Rename `TyCtxt::struct_span_lint_hir` as `TyCtxt::node_span_lint`.
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/lint.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/lint.rs30
1 files changed, 12 insertions, 18 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/lint.rs b/compiler/rustc_hir_analysis/src/astconv/lint.rs
index 27dc088d5dd..33e782abc68 100644
--- a/compiler/rustc_hir_analysis/src/astconv/lint.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/lint.rs
@@ -240,24 +240,18 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 diag.stash(self_ty.span, StashKey::TraitMissingMethod);
             } else {
                 let msg = "trait objects without an explicit `dyn` are deprecated";
-                tcx.struct_span_lint_hir(
-                    BARE_TRAIT_OBJECTS,
-                    self_ty.hir_id,
-                    self_ty.span,
-                    msg,
-                    |lint| {
-                        if self_ty.span.can_be_used_for_suggestions()
-                            && !self.maybe_lint_impl_trait(self_ty, lint)
-                        {
-                            lint.multipart_suggestion_verbose(
-                                "use `dyn`",
-                                sugg,
-                                Applicability::MachineApplicable,
-                            );
-                        }
-                        self.maybe_lint_blanket_trait_impl(self_ty, lint);
-                    },
-                );
+                tcx.node_span_lint(BARE_TRAIT_OBJECTS, self_ty.hir_id, self_ty.span, msg, |lint| {
+                    if self_ty.span.can_be_used_for_suggestions()
+                        && !self.maybe_lint_impl_trait(self_ty, lint)
+                    {
+                        lint.multipart_suggestion_verbose(
+                            "use `dyn`",
+                            sugg,
+                            Applicability::MachineApplicable,
+                        );
+                    }
+                    self.maybe_lint_blanket_trait_impl(self_ty, lint);
+                });
             }
         }
     }