diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-16 16:42:00 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-23 08:09:08 +1100 |
| commit | 15a4c4fc6f1bda15bbc6c40395ff709d1b7fd166 (patch) | |
| tree | 8ca5b6f4dd509fa123a62a75a5acfb0df6eb912f /compiler/rustc_middle | |
| parent | e164cf30f8f96551cedece4ed199d7ecb5832648 (diff) | |
Rename `struct_lint_level` as `lint_level`.
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/lint.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index c545300cb80..6ffa0819f35 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -258,7 +258,7 @@ pub fn explain_lint_level_source( /// It is not intended to call `emit`/`cancel` on the `DiagnosticBuilder` passed /// in the `decorate` callback. #[track_caller] -pub fn struct_lint_level( +pub fn lint_level( sess: &Session, lint: &'static Lint, level: Level, @@ -270,7 +270,7 @@ pub fn struct_lint_level( // Avoid codegen bloat from monomorphization by immediately doing dyn dispatch of `decorate` to // the "real" work. #[track_caller] - fn struct_lint_level_impl( + fn lint_level_impl( sess: &Session, lint: &'static Lint, level: Level, @@ -399,7 +399,7 @@ pub fn struct_lint_level( explain_lint_level_source(lint, level, src, &mut *err); err.emit() } - struct_lint_level_impl(sess, lint, level, src, span, msg, Box::new(decorate)) + lint_level_impl(sess, lint, level, src, span, msg, Box::new(decorate)) } /// Returns whether `span` originates in a foreign crate's external macro. diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index cd3a899a5f4..0d53870a0ba 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -7,7 +7,7 @@ pub mod tls; use crate::arena::Arena; use crate::dep_graph::{DepGraph, DepKindStruct}; use crate::infer::canonical::{CanonicalParamEnvCache, CanonicalVarInfo, CanonicalVarInfos}; -use crate::lint::struct_lint_level; +use crate::lint::lint_level; use crate::metadata::ModChild; use crate::middle::codegen_fn_attrs::CodegenFnAttrs; use crate::middle::resolve_bound_vars; @@ -2086,14 +2086,14 @@ impl<'tcx> TyCtxt<'tcx> { ) { let msg = decorator.msg(); let (level, src) = self.lint_level_at_node(lint, hir_id); - struct_lint_level(self.sess, lint, level, src, Some(span.into()), msg, |diag| { + lint_level(self.sess, lint, level, src, Some(span.into()), msg, |diag| { decorator.decorate_lint(diag); }) } /// Emit a lint at the appropriate level for a hir node, with an associated span. /// - /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature + /// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature #[rustc_lint_diagnostics] #[track_caller] pub fn node_span_lint( @@ -2105,7 +2105,7 @@ impl<'tcx> TyCtxt<'tcx> { decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>), ) { let (level, src) = self.lint_level_at_node(lint, hir_id); - struct_lint_level(self.sess, lint, level, src, Some(span.into()), msg, decorate); + lint_level(self.sess, lint, level, src, Some(span.into()), msg, decorate); } /// Emit a lint from a lint struct (some type that implements `DecorateLint`, typically @@ -2124,7 +2124,7 @@ impl<'tcx> TyCtxt<'tcx> { /// Emit a lint at the appropriate level for a hir node. /// - /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature + /// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature #[rustc_lint_diagnostics] #[track_caller] pub fn node_lint( @@ -2135,7 +2135,7 @@ impl<'tcx> TyCtxt<'tcx> { decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>), ) { let (level, src) = self.lint_level_at_node(lint, id); - struct_lint_level(self.sess, lint, level, src, None, msg, decorate); + lint_level(self.sess, lint, level, src, None, msg, decorate); } pub fn in_scope_traits(self, id: HirId) -> Option<&'tcx [TraitCandidate]> { |
