Created
August 7, 2022 13:22
-
-
Save algesten/8009cf37503513cfe341da5a62758799 to your computer and use it in GitHub Desktop.
Unhelpful tracing macro error
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
use tracing::{info_span, Span}; | |
pub struct Blah { | |
pub span: Span, | |
} | |
impl Blah { | |
pub fn new(name: &str) -> Self { | |
Blah { | |
span: info_span!(name), | |
} | |
} | |
} |
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
Compiling ice v0.1.0 (/Users/martin/dev/str0m/ice) | |
error[E0435]: attempt to use a non-constant value in a constant | |
--> ice/tests/blah.rs:10:30 | |
| | |
10 | span: info_span!(name), | |
| -----------^^^^- | |
| | | | |
| | non-constant value | |
| help: consider using `let` instead of `static`: `let CALLSITE` | |
For more information about this error, try `rustc --explain E0435`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment