dtolnay / paste

Macros for all your token pasting needs
Apache License 2.0
983 stars 53 forks source link

E0463 when linking dead code #66

Closed vstojkovic closed 2 years ago

vstojkovic commented 3 years ago

When I try to build code that uses paste and my RUSTFLAGS is contains the -Clink-dead-code, the compiler complains that it can't find the paste crate.

Minimal reproducible example:

use paste::paste;

fn hello_world() {
    println!("Hello, world!");
}

fn main() {
    paste! { [<hello _world>](); }
}

This works fine without -Clink-dead-code but fails with it.

I'm using Rust on Windows. I haven't tried this on a different OS.

dtolnay commented 2 years ago

The above code works for me with RUSTFLAGS='-Clink-dead-code' cargo run. I'll go ahead and close but if someone discovers any issue here related to the paste crate then I would be prepared to consider a PR. This crate itself is not doing anything platform specific.