<p dir="auto">Currently it only turns warnings from lints into errors. It should work like -Werror and replace all warnings by errors.</p>
<p dir="auto">Long winded test case using libcore: (build with --crate-type staticlib and --emit asm)</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(no_std, lang_items, asm, core)]
#![no_std]

use core::fmt;

#[macro_use]
extern crate core;

#[lang=&quot;panic_fmt&quot;]
extern fn panic_fmt(msg: &amp;fmt::Arguments, file: &amp;'static str, line: u32) -&gt; ! {
    loop { }
}

#[lang=&quot;stack_exhausted&quot;]
extern fn stack_exhausted() {
    loop { }
}

#[lang=&quot;eh_personality&quot;]
extern fn eh_personality() {
    loop { }
}

#[inline(always)]
fn foo() {
    panic!(&quot;Das Ist Nümberwang!&quot;);
}

fn black_box&lt;T&gt;(mut value: T) -&gt; T {
    unsafe {
        asm!(&quot;&quot; :: &quot;r&quot;(&amp;mut value) :: &quot;volatile&quot;);
    }
    value
}

pub fn main() {
    match black_box(5) {
        1 =&gt; foo(),
        48 =&gt; foo(),
        92 =&gt; foo(),
        23 =&gt; foo(),
        4 =&gt; foo(),
        70 =&gt; foo(),
        29 =&gt; foo(),
        36 =&gt; foo(),
        34 =&gt; foo(),
        58 =&gt; foo(),
        _ =&gt; { }
    }
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>no_std<span class="pl-kos">,</span> lang_items<span class="pl-kos">,</span> asm<span class="pl-kos">,</span> core<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-c1">#!<span class="pl-kos">[</span>no_std<span class="pl-kos">]</span></span>

<span class="pl-k">use</span> core<span class="pl-kos">::</span>fmt<span class="pl-kos">;</span>

<span class="pl-c1">#<span class="pl-kos">[</span>macro_use<span class="pl-kos">]</span></span>
<span class="pl-k">extern</span> <span class="pl-k">crate</span> core<span class="pl-kos">;</span>

<span class="pl-c1">#<span class="pl-kos">[</span>lang=<span class="pl-s">"panic_fmt"</span><span class="pl-kos">]</span></span>
<span class="pl-k">extern</span> <span class="pl-k">fn</span> <span class="pl-en">panic_fmt</span><span class="pl-kos">(</span><span class="pl-s1">msg</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span>fmt<span class="pl-kos">::</span><span class="pl-smi">Arguments</span><span class="pl-kos">,</span> <span class="pl-s1">file</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">str</span><span class="pl-kos">,</span> <span class="pl-s1">line</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -&gt; ! <span class="pl-kos">{</span>
    <span class="pl-k">loop</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>lang=<span class="pl-s">"stack_exhausted"</span><span class="pl-kos">]</span></span>
<span class="pl-k">extern</span> <span class="pl-k">fn</span> <span class="pl-en">stack_exhausted</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">loop</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>lang=<span class="pl-s">"eh_personality"</span><span class="pl-kos">]</span></span>
<span class="pl-k">extern</span> <span class="pl-k">fn</span> <span class="pl-en">eh_personality</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">loop</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>inline<span class="pl-kos">(</span>always<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">panic</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"Das Ist Nümberwang!"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">black_box</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-k">mut</span> <span class="pl-s1">value</span><span class="pl-kos">:</span> <span class="pl-smi">T</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">T</span> <span class="pl-kos">{</span>
    <span class="pl-k">unsafe</span> <span class="pl-kos">{</span>
        <span class="pl-en">asm</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">""</span> :: <span class="pl-s">"r"</span><span class="pl-kos">(</span>&amp;<span class="pl-k">mut</span> value<span class="pl-kos">)</span> :: <span class="pl-s">"volatile"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    value
<span class="pl-kos">}</span>

<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">match</span> <span class="pl-en">black_box</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-c1">1</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">48</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">92</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">23</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">4</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">70</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">29</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">36</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">34</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">58</span> =&gt; <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        _ =&gt; <span class="pl-kos">{</span> <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This duplicates the following 3 times in the resulting code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    leaq    _ZN3foo14_MSG_FILE_LINE20h7545777ae10911d4MaaE(%rip), %rdi
    callq   _ZN9panicking5panic20hefc2bd49b5114e0db7BE@PLT"><pre class="notranslate"><code class="notranslate">    leaq    _ZN3foo14_MSG_FILE_LINE20h7545777ae10911d4MaaE(%rip), %rdi
    callq   _ZN9panicking5panic20hefc2bd49b5114e0db7BE@PLT
</code></pre></div>
<p dir="auto">This may not seem too bad, but in real world cases you can end up with something on the order of this: <a href="https://gist.github.com/Tobba/ab10d5644d3d4ef97917">https://gist.github.com/Tobba/ab10d5644d3d4ef97917</a></p>