<p dir="auto">I'm running into this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./request.rs:1:7: 1:29 error: duplicate definition of type request
./request.rs:1 import mre::request::request;
                      ^~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">./request.rs:1:7: 1:29 error: duplicate definition of type request
./request.rs:1 import mre::request::request;
                      ^~~~~~~~~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">even though I only import <code class="notranslate">mre::request::request</code> once in that file. Perhaps I'm running into a compiler bug, or maybe I just don't quite understand the import rules. So, it would be helpful if the duplicate definition error also reported where rust first found the definition.</p>
<p dir="auto">This code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="static TEST: int = 10;
static TEST2: &amp;'static int = &amp;TEST;"><pre class="notranslate"><span class="pl-k">static</span> <span class="pl-v">TEST</span><span class="pl-kos">:</span> <span class="pl-smi">int</span> = <span class="pl-c1">10</span><span class="pl-kos">;</span>
<span class="pl-k">static</span> <span class="pl-v">TEST2</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">static</span> <span class="pl-smi">int</span> = <span class="pl-c1">&amp;</span><span class="pl-v">TEST</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Produces the following IR:</p>
<div class="highlight highlight-source-llvm notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@_ZN4TEST20h60213af30ae88ef1eaaE = internal constant i64 10
@const = private constant i64 10
@_ZN5TEST220hc4be0dea553bf116iaaE = internal constant i64* @const"><pre class="notranslate"><span class="pl-c1">@_ZN4TEST20h60213af30ae88ef1eaaE</span> = <span class="pl-k">internal</span> <span class="pl-k">constant</span> <span class="pl-k">i64</span> <span class="pl-c1">10</span>
<span class="pl-c1">@const</span> = <span class="pl-k">private</span> <span class="pl-k">constant</span> <span class="pl-k">i64</span> <span class="pl-c1">10</span>
<span class="pl-c1">@_ZN5TEST220hc4be0dea553bf116iaaE</span> = <span class="pl-k">internal</span> <span class="pl-k">constant</span> <span class="pl-k">i64*</span> <span class="pl-c1">@const</span></pre></div>
<p dir="auto">So <code class="notranslate">TEST2</code> points to a duplicate of <code class="notranslate">TEST</code>, namely <code class="notranslate">@const</code>, rather than <code class="notranslate">TEST</code> itself.</p>