Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spurious warning on empty proc macro crates #47655

Merged
merged 1 commit into from
Jan 23, 2018
Merged

Fix spurious warning on empty proc macro crates #47655

merged 1 commit into from
Jan 23, 2018

Commits on Jan 22, 2018

  1. Fix spurious warning on empty proc macro crates

    While attempting to reproduce #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.
    etaoins committed Jan 22, 2018
    Configuration menu
    Copy the full SHA
    e1bffbd View commit details
    Browse the repository at this point in the history