Skip to content

Dead code warning in fail!() expansion #16192

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

Closed
bluss opened this issue Aug 2, 2014 · 0 comments
Closed

Dead code warning in fail!() expansion #16192

bluss opened this issue Aug 2, 2014 · 0 comments
Labels
A-syntaxext Area: Syntax extensions

Comments

@bluss
Copy link
Member

bluss commented Aug 2, 2014

fail!() expansion triggers dead code warning. Regardless of position, I don't think fail should cause any warnings. I like to use fail!() to stub out match cases and function bodies.

Rustc version: rustc 0.12.0-pre-nightly (d7cfc34 2014-08-02 00:31:03 +0000)

<std macros>:7:9: 7:69 warning: code is never used: `FILE_LINE`, #[warn(dead_code)] on by default
<std macros>:7         static FILE_LINE: (&'static str, uint) = (file!(), line!());
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 29:2 note: in expansion of fail!
<std macros>:3:9: 4:6 note: expansion site
<std macros>:1:1: 29:2 note: in expansion of fail!
huonw added a commit to huonw/rust that referenced this issue Aug 4, 2014
The fail macro defines some function/static items internally, which got
a dead_code warning when `fail!()` is used inside a dead function. This
is ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.

Fixes rust-lang#16192.
bors added a commit that referenced this issue Aug 7, 2014
The fail macro defines some function/static items internally, which got
a dead_code warning when `fail!()` is used inside a dead function. This
is ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.

Fixes #16192.
bors added a commit that referenced this issue Aug 11, 2014
The fail macro defines some function/static items internally, which got
a dead_code warning when `fail!()` is used inside a dead function. This
is ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.

Fixes #16192.
@huonw huonw closed this as completed in 07aadc2 Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants