title: How can I suppress a Clippy warning originating from a macro?
body: <p>I have macro with return statement like this:</p>
  <pre class="lang-rust prettyprint-override"><code>macro_rules! return_fail {
      ( $res:expr ) =&gt; {
          match $res {
              Ok(val) =&gt; val,
              Err(e) =&gt; {
                  eprintln!(
                      &quot;An error: on {}:{} {}; aborting current function.&quot;,
                      file!(),
                      line!(),
                      e
                  );
                  return;
              }
          }
      };
  }
  
  fn bad(flag: bool) -&gt; Result&lt;(), String&gt; {
      if flag {
          Ok(())
      } else {
          Err(&quot;u r idiot&quot;.to_string())
      }
  }
  
  fn main() {
      return_fail!(bad(true));
      return_fail!(bad(false));
  }
  </code></pre>
  <p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=f9a0be3bc03a0f01b32e679e0b3986e5" rel="noreferrer">Rust playground</a></p>
  <p>This macro works fine when I use it in the middle of a function, but when I use it at the end of the function I get a warning from Clippy:</p>
  <pre class="lang-none prettyprint-override"><code>warning: unneeded `return` statement
    --&gt; src/main.rs:12:17
     |
  12 |                 return;
     |                 ^^^^^^^ help: remove `return`
  ...
  28 |     return_fail!(bad(false));
     |     ------------------------- in this macro invocation
     |
     = note: `#[warn(clippy::needless_return)]` on by default
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
     = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
  </code></pre>
  <p>How I can suppress this warning? I tried adding <code>#[allow(clippy::needless_return)]</code> to the upper line of macro definition but it did not work.</p>