title: Write::write_fmt causes page fault on a bare metal
body: <p>My experimental code crashes when running on bare x86_64-metal (page fault when IDT is not yet set), but works perfectly on aarch64.</p>
  
  <p>By careful tracing I figured out that the cause of this page fault consists of corrupted address (much higher than 0x200_000, while only the first 2M page is yet mapped as 1:1) of function "f" passed as an argument to core::fmt::ArgumentV1::new() function:</p>
  
  <pre><code>#[doc(hidden)]
  #[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
  pub fn new&lt;'b, T&gt;(x: &amp;'b T,
                    f: fn(&amp;T, &amp;mut Formatter) -&gt; Result) -&gt; ArgumentV1&lt;'b&gt; {
      unsafe {
          ArgumentV1 {
              formatter: mem::transmute(f),
              value: mem::transmute(x)
          }
      }
  } 
  </code></pre>
  
  <p>AFAIK this value is hard-coded by rustc compiler being result of compile-time processing of format_args! variadic arguments.</p>
  
  <p>Maybe you have suggestions what's wrong with this case. Thanks.</p>