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
indoc 0.2 doesn't work with format!() anymore #12
Comments
Thanks for reporting this! I didn't think of this case. I don't think there is a way to make it work on the stable compiler but I published 0.2.1 with an optional [dependencies]
indoc = { version = "0.2.1", features = ["unstable"] } #![feature(proc_macro)]
extern crate indoc;
use indoc::indoc;
fn main() {
let s = format!(indoc!("{}"), true);
assert_eq!(s, "true");
} |
Hm, I still get the same error when I use
|
Macros 2.0 macros are imported differently. Check out the code in my previous comment. |
If you get the same "format argument must be a string literal" error with indoc 0.2.1 with the |
Ah, I hadn't seen |
The indoc macro has never worked as a format string on stable Rust in the past, and it will continue to not work as a format string on stable Rust until the Macros 2.0 feature is stabilized. Other uses of indoc will work on stable Rust >=1.15.0 as of indoc 0.2. |
I was using indoc 0.1.15 for this function:
Now that I updated to indoc 0.2 it doesn't work anymore:
It seems that
indoc!()
doesn't return a string literal anymore.The text was updated successfully, but these errors were encountered: