]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #87296 - Aaron1011:inert-warn, r=petrochenkov
authorbors <bors@rust-lang.org>
Sat, 24 Jul 2021 13:19:17 +0000 (13:19 +0000)
committerbors <bors@rust-lang.org>
Sat, 24 Jul 2021 13:19:17 +0000 (13:19 +0000)
commit18840b0719aa766a1bc49ea2eb5dc2e4cde7da3f
tree5a2a6030e2f632bb5e06d57e6475c7b7074e3988
parentf9b95f92c8af07a24a870e5f6117aa5dfcee5f17
parentb41672eba8b0f06d2803cbd3bc2bd9ca7a8f2465
Auto merge of #87296 - Aaron1011:inert-warn, r=petrochenkov

Warn on inert attributes used on bang macro invocation

These attributes are currently discarded.
This may change in the future (see #63221), but for now,
placing inert attributes on a macro invocation does nothing,
so we should warn users about it.

Technically, it's possible for there to be attribute macro
on the same macro invocation (or at a higher scope), which
inspects the inert attribute. For example:

```rust
#[look_for_inline_attr]
#[inline]
my_macro!()

#[look_for_nested_inline]
mod foo { #[inline] my_macro!() }
```

However, this would be a very strange thing to do.
Anyone running into this can manually suppress the warning.
compiler/rustc_lint/src/context.rs
compiler/rustc_lint_defs/src/lib.rs