Closed
Description
This makes using codegen a bit more cumbersome.
What happens:
main_real.rs
:
// main_real.rs:
#[macro_use]
extern crate log;
fn main() {
info!("Hi!");
}
main.rs
:
include!{"main_real.rs"}
Cargo.toml
:
[package]
name = "macro-use-include"
version = "0.1.0"
authors = ["Cody P Schafer <dev@codyps.com>"]
[dependencies]
log = "*"
Attempt to build:
% cargo build
Compiling macro-use-include v0.1.0 (file:///home/cody/macro-use-include)
src/main_real.rs:5:5: 5:9 error: macro undefined: 'info!'
src/main_real.rs:5 info!("Hi");
^~~~
error: aborting due to previous error
Could not compile `macro-use-include`.
To learn more, run the command again with --verbose.
Moving main_real.rs
to main.rs
builds as expected.