Skip to content

Commit 4a538d3

Browse files
Do not hardcode lint name
1 parent 3599ada commit 4a538d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_lint/levels.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use rustc_errors::{struct_span_err, Applicability};
99
use rustc_hir as hir;
1010
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
1111
use rustc_hir::{intravisit, HirId};
12+
use rustc_lint::builtin::UNSAFE_OP_IN_UNSAFE_FN;
1213
use rustc_middle::hir::map::Map;
1314
use rustc_middle::lint::LintDiagnosticBuilder;
1415
use rustc_middle::lint::{struct_lint_level, LintLevelMap, LintLevelSets, LintSet, LintSource};
@@ -387,7 +388,7 @@ impl<'s> LintLevelsBuilder<'s> {
387388
}
388389

389390
fn check_gated_lint(&self, name: Symbol, span: Span) {
390-
if name.as_str() == "unsafe_op_in_unsafe_fn"
391+
if name.as_str() == UNSAFE_OP_IN_UNSAFE_FN.name
391392
&& !self.sess.features_untracked().unsafe_block_in_unsafe_fn
392393
{
393394
feature_err(

0 commit comments

Comments
 (0)