Skip to content

Dead code warning in fail!() expansion #16192

Closed
@bluss

Description

@bluss

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions