# Explicitly marking unsafe macro expressions

**URL:** <https://internals.rust-lang.org/t/explicitly-marking-unsafe-macro-expressions/9425>\
**Category:** Unsafe Code Guidelines\
**Created:** [February 12, 2019, 6:25pm UTC](https://internals.rust-lang.org/t/explicitly-marking-unsafe-macro-expressions/9425 "2019-02-12T18:25:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [February 12, 2019, 8:32pm UTC](https://internals.rust-lang.org/t/explicitly-marking-unsafe-macro-expressions/9425/4 "2019-02-12T20:32:18Z")

</div>

How is this being in a macro any worse that it being in a function?

Compare the macro example with this:

```rust
unsafe fn unsafe_operation() -> u8 {
	1
}

fn value_equals_unsafe_operation<T: PartialEq>(a: T) -> bool {
    unsafe {
        a == unsafe_operation()
    }
}

```

So overall this feels more like “I want to know if crates I’m using use unsafe”, not something specific to macros.

---

_[View the full topic](https://internals.rust-lang.org/t/explicitly-marking-unsafe-macro-expressions/9425)._
