about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-01-23 17:03:43 +0800
committerkennytm <kennytm@gmail.com>2018-01-23 22:30:58 +0800
commit117eb68122cee0346e15f83c248859a89063a86b (patch)
treefc485ed15f61814434e4665f899d344f04fabb9f /src/rustllvm/RustWrapper.cpp
parent9d26a25bb627e8cee8476331cf25212a5aacebd1 (diff)
parente1bffbdf66cecc442e8d9e20642df82a155e2aa0 (diff)
downloadrust-117eb68122cee0346e15f83c248859a89063a86b.tar.gz
rust-117eb68122cee0346e15f83c248859a89063a86b.zip
Rollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate, r=alexcrichton
Fix spurious warning on empty proc macro crates

While attempting to reproduce rust-lang/rust#47086 I noticed the following warning:

```shell
> rustc /dev/null --crate-type proc-macro
warning: unused variable: `registrar`
 --> /dev/null:0:1
```

As there are no macros to register the automatically generated registrar function for the crate has no body. As a result its `registrar` argument is unused triggering the above warning.

The warning is confusing and not easily actionable by the developer. It could also be triggered legitimately by e.g. having all of the macros in a crate #[cfg]'ed out.

Fix by naming the generated argument `_registrar` inside `mk_registrar()`. This suppresses the unused variable warning.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions