This website requires JavaScript.
Explore
Help
Register
Sign In
rust-lang
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Actions
2
Packages
Projects
Releases
Wiki
Activity
Files
300901b70509a0af2d971aa6f6104300da24212c
rust
/
tests
/
ui
/
proc-macro
/
auxiliary
/
empty-crate.rs
6 lines
93 B
Rust
Raw
Normal View
History
Unescape
Escape
tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.
2018-11-24 15:34:13 +02:00
// force-host
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.
2018-01-22 20:58:21 +11:00
// no-prefer-dynamic
#![
crate_type =
"
proc-macro
"
]
#![
deny(unused_variables)
]
Reference in New Issue
Copy Permalink