<p dir="auto">I've had a few conversations on IRC about using <code class="notranslate">#![no_std]</code> in Rust libraries. There are comments around (such as <a href="https://github.com/servo/html5ever/blob/cb98c0cb700835f7473a9fc09a7ee9564ef3c73e/src/lib.rs#L16-L18">here in html5ever</a>) that using <code class="notranslate">#![no_std]</code> should be used if one wants to write a Rust library that is going to be used from other languages. It's not really clear to me how accurate that recommendation still is currently / will be at 1.0 with the changes to std that have happened over the past months; however, assuming it's still true, I think there are a couple of problems that don't seem to have easy solutions:</p>
<ul dir="auto">
<li>It's really easy to accidentally pull in std by using another crate that links std (html5ever currently has this problem - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="46222730" data-permission-text="Title is private" data-url="https://github.com/servo/html5ever/issues/47" data-hovercard-type="issue" data-hovercard-url="/servo/html5ever/issues/47/hovercard" href="https://github.com/servo/html5ever/issues/47">servo/html5ever#47</a>).</li>
<li>According to <a href="http://doc.rust-lang.org/guide-unsafe.html#avoiding-the-standard-library" rel="nofollow">the unsafe docs</a>, a crate using <code class="notranslate">#![no_std]</code> needs to define a few lang_items like <code class="notranslate">stack_exhausted</code>. If two independently-developed crates both define the lang items, you get duplicate name errors when trying to use both simultaneously.</li>
</ul>
<p dir="auto">It would be great to be able  to do some thing like this :<br>
<code class="notranslate">type A = { a: int }; type B =  {b: int} herit A;</code></p>
<p dir="auto">So in fact<code class="notranslate">B = {a: int, b: int};</code></p>
<p dir="auto">It could maybe replace an object model when combined with interfaces.</p>