Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Rust interpreter hanging with println!(add_one!(two)) #35

Closed
@brainstorm

Description

@brainstorm

Hello @dtolnay,

There's an ongoing Rust interpreter issue related with your package on rust-lang/rust#62167, the following changeset reproduces the issue (the second format-less println! hangs the building process forever):

$ git diff
diff --git a/example/src/main.rs b/example/src/main.rs
index 127a36c..d72f1c2 100644
--- a/example/src/main.rs
+++ b/example/src/main.rs
@@ -1,7 +1,7 @@
 use demo_hack::add_one;

 fn main() {
-    let two = 2;
-    let nine = add_one!(two) + add_one!(2 + 3);
-    println!("nine = {}", nine);
+    let one = 1;
+    println!("{}", add_one(one));
+    println!(add_one!(one));
 }

Then building triggers Rust's interpreter hanging forever with the example code above:

(base) brainstorm:proc-macro-hack romanvg$ cargo build
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
(base) brainstorm:proc-macro-hack romanvg$ cd example/
(base) brainstorm:example romanvg$ cargo build
   Compiling example v0.0.0 (/Users/romanvg/tmp/proc-macro-hack/example)
    Building [===================================================>     ] 11/12: example(bin)

Can you give some feedback to the aforementioned rustlang issue? Thanks in advance!

/cc dotenv-rs/dotenv#22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions