<p dir="auto">So, i am compileing a version of rustboot that uses some changes that someone else had made so that it could display text on the screen, but when I compile I get this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/lib/IR/Instructions.cpp:276: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef&lt;llvm::Value*&gt;, const llvm::Twine&amp;): Assertion `(Args.size() == FTy-&gt;getNumParams() || (FTy-&gt;isVarArg() &amp;&amp; Args.size() &gt; FTy-&gt;getNumParams())) &amp;&amp; &quot;Calling a function with bad signature!&quot;' failed.
make: *** [main.o] Aborted (core dumped)"><pre class="notranslate"><code class="notranslate">rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/lib/IR/Instructions.cpp:276: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef&lt;llvm::Value*&gt;, const llvm::Twine&amp;): Assertion `(Args.size() == FTy-&gt;getNumParams() || (FTy-&gt;isVarArg() &amp;&amp; Args.size() &gt; FTy-&gt;getNumParams())) &amp;&amp; "Calling a function with bad signature!"' failed.
make: *** [main.o] Aborted (core dumped)
</code></pre></div>
<p dir="auto">i have checked all the other issues about this, but none of them have helped. My code looks like this:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![no_std]
#![allow(ctypes)]
#![feature(lang_items)]

#[allow(dead_code)]
enum Color {
    Black      = 0,
    Blue       = 1,
    Green      = 2,
    Cyan       = 3,
    Red        = 4,
    Pink       = 5,
    Brown      = 6,
    LightGray  = 7,
    DarkGray   = 8,
    LightBlue  = 9,
    LightGreen = 10,
    LightCyan  = 11,
    LightRed   = 12,
    LightPink  = 13,
    Yellow     = 14,
    White      = 15,
}

enum DisplayInfo {
    VGAWIDTH = 80,
    VGAHEIGHT = 25,
    VGAADDRESS = 0xb8000,
}

#[lang=&quot;sized&quot;]
fn clear_screen(background: Color) {
    let limit = 80u * 25u;
    let mut i = 0u;
    while i &lt; limit {
        unsafe {
            *((VGAADDRESS as u16 + i as u16 * 2) as *mut u16) = (background as u16) &lt;&lt; 12;
        }
        i += 1;
    }
}

fn make_vgaentry(c: u8, fg: Color, bg: Color) -&gt; u16 {
    let color = fg as u16 | (bg as u16 &lt;&lt; 4);
    c as u16 | (color &lt;&lt; 8)
}
pub fn putc(x: u16, y: u16, c: u8) {
    let idx: uint = (y * VGAWIDTH as u16 * 2 + x * 2) as uint;
    unsafe {
        *((VGAADDRESS as u16 + idx as u16) as *mut u16) = make_vgaentry(c, Green, Black)
    }
}

#[lang=&quot;fail_bounds_check&quot;]
pub fn write_x_y(s: &amp;[u8], x: u16, y: u16, len: uint) {
    let mut i = 0u;
    while i &lt; len {
        putc(x + i as u16, y, s[i]);
        i += 1;
    }
}


#[no_mangle]
#[no_split_stack]
pub fn main() {
    clear_screen(Black);
    let prompt = b&quot;==&gt; &quot;;
    write_x_y(prompt, 2, 3, 4);
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>no_std<span class="pl-kos">]</span></span>
<span class="pl-c1">#!<span class="pl-kos">[</span>allow<span class="pl-kos">(</span>ctypes<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>lang_items<span class="pl-kos">)</span><span class="pl-kos">]</span></span>

<span class="pl-c1">#<span class="pl-kos">[</span>allow<span class="pl-kos">(</span>dead_code<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">enum</span> <span class="pl-smi">Color</span> <span class="pl-kos">{</span>
    <span class="pl-v">Black</span>      = <span class="pl-c1">0</span><span class="pl-kos">,</span>
    <span class="pl-v">Blue</span>       = <span class="pl-c1">1</span><span class="pl-kos">,</span>
    <span class="pl-v">Green</span>      = <span class="pl-c1">2</span><span class="pl-kos">,</span>
    <span class="pl-v">Cyan</span>       = <span class="pl-c1">3</span><span class="pl-kos">,</span>
    <span class="pl-v">Red</span>        = <span class="pl-c1">4</span><span class="pl-kos">,</span>
    <span class="pl-v">Pink</span>       = <span class="pl-c1">5</span><span class="pl-kos">,</span>
    <span class="pl-v">Brown</span>      = <span class="pl-c1">6</span><span class="pl-kos">,</span>
    <span class="pl-v">LightGray</span>  = <span class="pl-c1">7</span><span class="pl-kos">,</span>
    <span class="pl-v">DarkGray</span>   = <span class="pl-c1">8</span><span class="pl-kos">,</span>
    <span class="pl-v">LightBlue</span>  = <span class="pl-c1">9</span><span class="pl-kos">,</span>
    <span class="pl-v">LightGreen</span> = <span class="pl-c1">10</span><span class="pl-kos">,</span>
    <span class="pl-v">LightCyan</span>  = <span class="pl-c1">11</span><span class="pl-kos">,</span>
    <span class="pl-v">LightRed</span>   = <span class="pl-c1">12</span><span class="pl-kos">,</span>
    <span class="pl-v">LightPink</span>  = <span class="pl-c1">13</span><span class="pl-kos">,</span>
    <span class="pl-v">Yellow</span>     = <span class="pl-c1">14</span><span class="pl-kos">,</span>
    <span class="pl-v">White</span>      = <span class="pl-c1">15</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>

<span class="pl-k">enum</span> <span class="pl-smi">DisplayInfo</span> <span class="pl-kos">{</span>
    <span class="pl-v">VGAWIDTH</span> = <span class="pl-c1">80</span><span class="pl-kos">,</span>
    <span class="pl-v">VGAHEIGHT</span> = <span class="pl-c1">25</span><span class="pl-kos">,</span>
    <span class="pl-v">VGAADDRESS</span> = <span class="pl-c1">0xb8000</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">"sized"</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">clear_screen</span><span class="pl-kos">(</span><span class="pl-s1">background</span><span class="pl-kos">:</span> <span class="pl-smi">Color</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> limit = <span class="pl-c1">80</span>u <span class="pl-c1">*</span> <span class="pl-c1">25</span>u<span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> i = <span class="pl-c1">0</span>u<span class="pl-kos">;</span>
    <span class="pl-k">while</span> i &lt; limit <span class="pl-kos">{</span>
        <span class="pl-k">unsafe</span> <span class="pl-kos">{</span>
            <span class="pl-c1">*</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-v">VGAADDRESS</span> <span class="pl-k">as</span> <span class="pl-smi">u16</span> + i <span class="pl-k">as</span> <span class="pl-smi">u16</span> <span class="pl-c1">*</span> <span class="pl-c1">2</span><span class="pl-kos">)</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-smi">u16</span><span class="pl-kos">)</span> = <span class="pl-kos">(</span>background <span class="pl-k">as</span> <span class="pl-smi">u16</span><span class="pl-kos">)</span> &lt;&lt; <span class="pl-c1">12</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
        i += <span class="pl-c1">1</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">make_vgaentry</span><span class="pl-kos">(</span><span class="pl-s1">c</span><span class="pl-kos">:</span> <span class="pl-smi">u8</span><span class="pl-kos">,</span> <span class="pl-s1">fg</span><span class="pl-kos">:</span> <span class="pl-smi">Color</span><span class="pl-kos">,</span> <span class="pl-s1">bg</span><span class="pl-kos">:</span> <span class="pl-smi">Color</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">u16</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> color = fg <span class="pl-k">as</span> <span class="pl-smi">u16</span> | <span class="pl-kos">(</span>bg <span class="pl-k">as</span> <span class="pl-smi">u16</span> &lt;&lt; <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    c <span class="pl-k">as</span> <span class="pl-smi">u16</span> | <span class="pl-kos">(</span>color &lt;&lt; <span class="pl-c1">8</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">putc</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">:</span> <span class="pl-smi">u16</span><span class="pl-kos">,</span> <span class="pl-s1">y</span><span class="pl-kos">:</span> <span class="pl-smi">u16</span><span class="pl-kos">,</span> <span class="pl-s1">c</span><span class="pl-kos">:</span> <span class="pl-smi">u8</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> idx<span class="pl-kos">:</span> <span class="pl-smi">uint</span> = <span class="pl-kos">(</span>y <span class="pl-c1">*</span> <span class="pl-v">VGAWIDTH</span> <span class="pl-k">as</span> <span class="pl-smi">u16</span> <span class="pl-c1">*</span> <span class="pl-c1">2</span> + x <span class="pl-c1">*</span> <span class="pl-c1">2</span><span class="pl-kos">)</span> <span class="pl-k">as</span> <span class="pl-smi">uint</span><span class="pl-kos">;</span>
    <span class="pl-k">unsafe</span> <span class="pl-kos">{</span>
        <span class="pl-c1">*</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-v">VGAADDRESS</span> <span class="pl-k">as</span> <span class="pl-smi">u16</span> + idx <span class="pl-k">as</span> <span class="pl-smi">u16</span><span class="pl-kos">)</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-smi">u16</span><span class="pl-kos">)</span> = <span class="pl-en">make_vgaentry</span><span class="pl-kos">(</span>c<span class="pl-kos">,</span> <span class="pl-v">Green</span><span class="pl-kos">,</span> <span class="pl-v">Black</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">"fail_bounds_check"</span><span class="pl-kos">]</span></span>
<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">write_x_y</span><span class="pl-kos">(</span><span class="pl-s1">s</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">x</span><span class="pl-kos">:</span> <span class="pl-smi">u16</span><span class="pl-kos">,</span> <span class="pl-s1">y</span><span class="pl-kos">:</span> <span class="pl-smi">u16</span><span class="pl-kos">,</span> <span class="pl-s1">len</span><span class="pl-kos">:</span> <span class="pl-smi">uint</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> i = <span class="pl-c1">0</span>u<span class="pl-kos">;</span>
    <span class="pl-k">while</span> i &lt; len <span class="pl-kos">{</span>
        <span class="pl-en">putc</span><span class="pl-kos">(</span>x + i <span class="pl-k">as</span> <span class="pl-smi">u16</span><span class="pl-kos">,</span> y<span class="pl-kos">,</span> s<span class="pl-kos">[</span>i<span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        i += <span class="pl-c1">1</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>no_mangle<span class="pl-kos">]</span></span>
<span class="pl-c1">#<span class="pl-kos">[</span>no_split_stack<span class="pl-kos">]</span></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-en">clear_screen</span><span class="pl-kos">(</span><span class="pl-v">Black</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> prompt = <span class="pl-s">b"==&gt; "</span><span class="pl-kos">;</span>
    <span class="pl-en">write_x_y</span><span class="pl-kos">(</span>prompt<span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I am fairly new to rust, and pretty much copy-and-pasteing stuff in. You will notice I cannot program very rust-idiomaticly becouse I have  to do without the standard library, and cannot compile libcore for i386-intel-linux, which is what the loader assembly code is written for.</p>
<p dir="auto">These aren't currently well-defined by the language.  If you define anything with a somewhat matching LLVM signature, it will compile. Not only does it not care about the type signatures matching what it expects, there is no handling for these being defined on the wrong types of AST nodes.</p>