-
Notifications
You must be signed in to change notification settings - Fork 258
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
error[E0423]: expected function, found macro log::set_boxed_logger
- did you mean `log::set_boxed_logger!(...)?
#303
Comments
That's very strange - set_boxed_logger is definitely a function and not a macro! Probably worth filing this over on rust-lang/rust since it seems like a compiler bug. |
The incorrect "expected function, found macro" compile error looks like rust-lang/rust#40788 Found a fix: needed to update the Cargo.toml dependency in my project to include the "std" feature: -log = "0.4.5"
+log = { version = "0.4.5", features = ["std"] } |
Minimal example: src/main.rs: #[macro_use]
extern crate log;
fn main() {
log::set_boxed_logger(Box::new(1));
} Cargo.toml: [package]
name = "logtest"
version = "0.1.0"
[dependencies]
#log = { version = "0.4.6", features = ["std"] }
log = "0.4.6" Fails with:
|
adding std does not work for me I have the same issue with logging E0423 |
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When updating a seemingly unrelated dependency (hyper 0.8.0, to either hyper 0.12.11 or reqwest 0.9.4), I get an error related to setting the boxed logger:
I could try to regress further, but any idea what could cause this? If I try the compiler's suggestion, then
log::set_boxed_logger!
isn't found (and that doesn't match the documentation either so I don't think it is right).The text was updated successfully, but these errors were encountered: