about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
diff options
context:
space:
mode:
authorcarbotaniuman <41451839+carbotaniuman@users.noreply.github.com>2024-04-20 23:54:50 -0500
committercarbotaniuman <41451839+carbotaniuman@users.noreply.github.com>2024-06-06 20:26:27 -0500
commit67f5dd1ef112c8a87bc3353793cf4c1cece10c2d (patch)
treeafbeed6330ff7adea5d84a5ecf17dc3d1d3601b8 /compiler/rustc_ast_lowering/src
parent76e7a0849c07d73e4d9afde8036ee8c450127cc8 (diff)
downloadrust-67f5dd1ef112c8a87bc3353793cf4c1cece10c2d.tar.gz
rust-67f5dd1ef112c8a87bc3353793cf4c1cece10c2d.zip
Parse unsafe attributes
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs1
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index eb206a09be3..5fbae6a34e5 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -1801,6 +1801,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
         let attr = attr::mk_attr_nested_word(
             &self.tcx.sess.psess.attr_id_generator,
             AttrStyle::Outer,
+            Unsafe::No,
             sym::allow,
             sym::unreachable_code,
             self.lower_span(span),
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 023dc6d52c3..e4959853d3f 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -911,6 +911,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         let kind = match attr.kind {
             AttrKind::Normal(ref normal) => AttrKind::Normal(P(NormalAttr {
                 item: AttrItem {
+                    unsafety: normal.item.unsafety,
                     path: normal.item.path.clone(),
                     args: self.lower_attr_args(&normal.item.args),
                     tokens: None,