diff --git a/README.md b/README.md new file mode 100644 index 0000000..76bff25 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# reproduction + +To reproduce the issue, run `./repro.sh`. + +This will clean the build, and then toggle two lines between +``` +// 1 +// 2 +``` +``` +// 1 +``` +which is enough to trigger the issue. + +**Make sure to `export RUSTFLAGS=-Zincremental-verify-ich` first, otherwise it may not reproduce**. \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index b970152..17c012a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,7 +53,7 @@ pub async fn bar_baz() { } // 1 - // 2 +// 2 #[derive(proc_macro_thing::MyMacro)] #[helper] diff --git a/toggle.js b/toggle.js index bd68610..14ca15a 100644 --- a/toggle.js +++ b/toggle.js @@ -7,7 +7,7 @@ const one = c.findIndex(l => l.includes("// 1")); if (c[one + 1].includes("// 2")) { c.splice(one + 1, 1); } else { - c.splice(one + 1, 0, " // 2") + c.splice(one + 1, 0, "// 2") } fs.writeFileSync("src/main.rs", c.join("\n"));