diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-08-08 11:54:15 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-08-08 11:54:20 +0200 |
| commit | 866bc26475277c31f0fc5409ac061951ae48b827 (patch) | |
| tree | 6edeae7a93a2eceb99f5e4a258d6241efb9aa918 /compiler/rustc_lint/src/builtin.rs | |
| parent | 2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a (diff) | |
| download | rust-866bc26475277c31f0fc5409ac061951ae48b827.tar.gz rust-866bc26475277c31f0fc5409ac061951ae48b827.zip | |
Revert "Port `#[allow_internal_unsafe]` to the new attribute system"
This reverts commit 4f7a6ace9e2f2192af7b5d32f4b1664189e0e143.
Diffstat (limited to 'compiler/rustc_lint/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 51b10191046..c893b723375 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -14,7 +14,6 @@ //! [`crate::late_lint_methods!`] invocation in `lib.rs`. use std::fmt::Write; -use std::slice; use ast::token::TokenKind; use rustc_abi::BackendRepr; @@ -22,7 +21,6 @@ use rustc_ast::tokenstream::{TokenStream, TokenTree}; use rustc_ast::visit::{FnCtxt, FnKind}; use rustc_ast::{self as ast, *}; use rustc_ast_pretty::pprust::expr_to_string; -use rustc_attr_parsing::AttributeParser; use rustc_errors::{Applicability, LintDiagnostic}; use rustc_feature::GateIssue; use rustc_hir as hir; @@ -251,16 +249,7 @@ impl UnsafeCode { impl EarlyLintPass for UnsafeCode { fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &ast::Attribute) { - if AttributeParser::parse_limited( - cx.builder.sess(), - slice::from_ref(attr), - sym::allow_internal_unsafe, - attr.span, - DUMMY_NODE_ID, - Some(cx.builder.features()), - ) - .is_some() - { + if attr.has_name(sym::allow_internal_unsafe) { self.report_unsafe(cx, attr.span, BuiltinUnsafe::AllowInternalUnsafe); } } |
