<p dir="auto">It seems the <code class="notranslate">debug!</code> code isn't properly pushing a span onto the macro expansion span stack. This code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fn main() {
    let a = ~&quot;&quot;;
    debug!(&quot;foo: %s %s&quot;, a);
}"><pre class="notranslate"><code class="notranslate">fn main() {
    let a = ~"";
    debug!("foo: %s %s", a);
}
</code></pre></div>
<p dir="auto">Only reports the error inside the macro, but not where that macro is getting used:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;core-macros&gt;:33:24: 33:42 error: not enough arguments to fmt! for the given format string
&lt;core-macros&gt;:33             __log(4u32, fmt!( $($arg),+ ))
                                         ^~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">&lt;core-macros&gt;:33:24: 33:42 error: not enough arguments to fmt! for the given format string
&lt;core-macros&gt;:33             __log(4u32, fmt!( $($arg),+ ))
                                         ^~~~~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">If you pass an immutable reference through two structs, one of which is a trait, you can take an immutable reference to a variable that will be mutated later, and the compiler will compile. For a proof of concept, see <a href="https://github.com/GBGamer/rust-test-obfuscating">here</a>, and if you want to see it in an actual use case, see <a href="https://github.com/GBGamer/roguelike-rs/tree/5766312abf1c4eb63281d2aa431349a1eedeb2a6/src">here</a> (look in the main file).</p>
<p dir="auto">I don't know if this is an issue or not, it didn't cause any safety issues when I used it. Is there a rust-ier way of doing the type of thing I did in the second example (allow an immutable reference to a value that will be mutated, in order to see the new value).</p>