# Pre-RFC: unsafe attributes

**URL:** <https://internals.rust-lang.org/t/pre-rfc-unsafe-attributes/17462>\
**Category:** language design\
**Created:** [September 28, 2022, 10:59am UTC](https://internals.rust-lang.org/t/pre-rfc-unsafe-attributes/17462 "2022-09-28T10:59:22Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![afetisov](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/afetisov/32/8508_2.png) [@afetisov](https://internals.rust-lang.org/u/afetisov)\
**Post date:** [October 4, 2022, 10:57am UTC](https://internals.rust-lang.org/t/pre-rfc-unsafe-attributes/17462/28 "2022-10-04T10:57:13Z")

</div>

> [@simonbuchan](#):
>
> it's the macro's responsibility to ensure that it's upholding the safety requirements

Macros don't have any such responsibility. They can expand to whatever code they like, whether sound or not.

```rust
macro_rules! totally_safe {
    ($($tt: tt)*) => { unsafe { $($tt)* } }
}

totally_safe!(::std::ptr::null::<u32>().read());

```

That's [a problem](https://internals.rust-lang.org/t/hidden-unsafe-due-to-unintentionally-abusable-macros-and-include/14107). There is no way to say that the macro is unsafe to use. There is no safety hygiene, which could prevent laundering unsafe code through an unsuspecting macro. There is even no requirement to [have an **unsafe** token](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c9010eef945a5184b1a6aa68668fa015).

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-unsafe-attributes/17462)._
