-
Notifications
You must be signed in to change notification settings - Fork 731
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
Unqualified line!
macro usage inside info!
causes issues with ratatui_macros
#3023
Comments
It's also a problem in the metadata! macro in tracing-core. |
joshka
added a commit
to joshka/tracing
that referenced
this issue
Jun 30, 2024
This commit fixes a bug where a macro call to macros defined in the standard lib from the `tracing` and `tracing-core` crates could be resolved to a local macro with the same name, causing a compilation error. This commit prefixes these calls with `::core::` to ensure that they are resolved to the standard library macros. Fixes: <tokio-rs#3023>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just importing
ratatui_macros::line
causestracing::info
to compile error:Here's the error:
with this
Cargo.toml
I get similar errors with other macros from
tracing
, but I don't get any errors withlog::info!
or other macros fromlog
.Here's the diff of
cargo expand
without and withuse ratatui_macros::line;
tracing
seems to be adding a line like this::core::option::Option::Some(::ratatui::text::Line::default()),
whenuse ratatui_macros::line
is in the file.The issue stems from unqualified usages of
line!
like these:tracing/tracing/src/macros.rs
Line 700 in ba387dd
tracing/tracing/src/macros.rs
Line 861 in ba387dd
tracing/tracing/src/macros.rs
Line 1191 in ba387dd
Making them
std::line!()
should resolve this issue.Thanks to @joshka for helping figure out the issue.
The text was updated successfully, but these errors were encountered: