Created
April 7, 2020 19:28
-
-
Save AfoHT/87e3ca58c6670c2298aaec392a9cd97b to your computer and use it in GitHub Desktop.
cfgstruct with panic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ cargo build | |
Compiling cfgstruct-macros v0.1.0 (/home/henrik/rust/cfg-proc_macro_test/cfgstruct/macros) | |
warning: unreachable expression | |
--> macros/src/lib.rs:12:5 | |
| | |
11 | panic!("{}", item); | |
| ------------------- any code following this expression is unreachable | |
12 | item | |
| ^^^^ unreachable expression | |
| | |
= note: `#[warn(unreachable_code)]` on by default | |
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) | |
Compiling cfgstruct v0.1.0 (/home/henrik/rust/cfg-proc_macro_test/cfgstruct) | |
Input to proc_macro_attribute: | |
##################################################### | |
fn main() { | |
let res = LateResources{x: 0, dummy: (),}; | |
println!("{:#?}", res); | |
#[cfg(feature = "feature_x")] | |
println!("Hello, world!"); | |
} | |
##################################################### | |
End of proc macro input. | |
error: custom attribute panicked | |
--> src/main.rs:10:1 | |
| | |
10 | #[init] | |
| ^^^^^^^ | |
| | |
= help: message: fn main() { | |
let res = LateResources{x: 0, dummy: (),}; | |
println!("{:#?}", res); | |
#[cfg(feature = "feature_x")] | |
println!("Hello, world!"); | |
} | |
error: aborting due to previous error | |
error: could not compile `cfgstruct`. | |
To learn more, run the command again with --verbose. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment