<p dir="auto">A crate that uses the core library gets a mysterious error message with a dummy span.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#[link(name = &quot;rustmeta&quot;,                                                                                                                                                     
       vers = &quot;0.2&quot;,                                                                                                                                                          
       uuid = &quot;f19085c3-dd45-467d-b76b-cb07e5ecd13c&quot;)];                                                                                                                       

#[crate_type = &quot;lib&quot;];                                                                                                                                                        

use core(vers = &quot;0.2&quot;);                                                                                                                                                       
use std(vers = &quot;0.2&quot;);                                                                                                                                                        
use rustsyntax(vers = &quot;0.2&quot;);                                                                                                                                                 

import core::*;                                                                                                                                                               
import syntax = rustsyntax;"><pre class="notranslate"><code class="notranslate">#[link(name = "rustmeta",                                                                                                                                                     
       vers = "0.2",                                                                                                                                                          
       uuid = "f19085c3-dd45-467d-b76b-cb07e5ecd13c")];                                                                                                                       

#[crate_type = "lib"];                                                                                                                                                        

use core(vers = "0.2");                                                                                                                                                       
use std(vers = "0.2");                                                                                                                                                        
use rustsyntax(vers = "0.2");                                                                                                                                                 

import core::*;                                                                                                                                                               
import syntax = rustsyntax;
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="../src/librustmeta/rustmeta.rc:1:0: 1:0 error: duplicate definition of module core
../src/librustmeta/rustmeta.rc:1 #[link(name = &quot;rustmeta&quot;,"><pre class="notranslate"><code class="notranslate">../src/librustmeta/rustmeta.rc:1:0: 1:0 error: duplicate definition of module core
../src/librustmeta/rustmeta.rc:1 #[link(name = "rustmeta",
</code></pre></div>
<p dir="auto">We know this happened because of the injected core library, so we should say so.</p>
<p dir="auto">In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="14604689" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/6670" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/6670/hovercard" href="https://github.com/rust-lang/rust/pull/6670">#6670</a> I add a basic form of static assertions (as suggested by graydon in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="14473133" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/6568" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/6568/hovercard" href="https://github.com/rust-lang/rust/issues/6568">#6568</a>), but it's not nice to use. The biggest problem with it is you need a static variable with a name, that goes through trans and ends up in the object file.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kud1ing/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kud1ing">@kud1ing</a> suggested <code class="notranslate">static_assert!()</code>, which I think is a nice API but would need some invasive changed to the compiler (I think, uncertain).</p>