-
-
Notifications
You must be signed in to change notification settings - Fork 18
Using it within println hangs compilation #21
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
Comments
Thanks! Check out #17. As a workaround you can use [dependencies]
indoc = { version = "0.2", features = ["unstable"] } #![feature(proc_macro, proc_macro_non_items)]
extern crate indoc;
use indoc::indoc;
fn main() {
println!(indoc!(""));
} |
The hang is a compiler bug: rust-lang/rust#44692. |
it doesn't hang for me, but indoc in format macros is not allowed because the (stable) compiler thinks it is not a string literal. Really unfortunate, as that's the use case I had for it :/ |
It seems the hang was fixed in rustc 1.38.0. error: format argument must be a string literal
--> src/main.rs:4:14
|
4 | println!(indoc!(""));
| ^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: you might be missing a string literal to format with
|
4 | println!("{}", indoc!(""));
| ^^^^^ |
@MightyPork I filed #36 to consider adding println-like macros with indented strings. |
println!(indoc!("hello world"));
hangs compilation
The text was updated successfully, but these errors were encountered: