title: Retrieving a pointer to float from Rust FFI
body: <p>Ubuntu 13.04, Rust 0.6. I'm trying to use the Rust FFI to operate with openblas. The following code doesn't work as expected.</p>
  
  <pre><code>use core::io::println;
  use core::libc::{c_int, c_float};
  use core::vec::raw::to_ptr;
  
  extern mod openblas {
      /*  Single precision dot product.
          sdot takes 5 args: number of elements,
                             pointer to a,
                             storage spacing for elements of a,
                             pointer to b,
                             storage spacing for elements of b
          returns a^T . b
      */
      fn cblas_sdot(N: c_int, x: *c_float, incx: c_int,
                    y: *c_float, incy: c_int) -&gt; *c_float;
  }
  
  pub fn sdot(a: &amp;[c_float], b: &amp;[c_float]) -&gt; *c_float {
      unsafe {
          openblas::cblas_sdot(3 as c_int, to_ptr(a), 1 as c_int,
                               to_ptr(b), 1 as c_int)
      }
  }
  
  fn main() {
      let a = [1. as c_float, 2. as c_float, 4. as c_float];
      let b = [1. as c_float, 2. as c_float, 5. as c_float];
      let x = sdot(a, b);
      println(fmt!("%?", x));
  
  }
  </code></pre>
  
  <p>edit: I expected it to print 25, as a borrowed pointer. I got 140125321300160, which might be the address of the float.</p>