You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn f() { assert!(false); }
struct A(f64);
struct B { x: Option<A> }
fn main() { let mut t = B { x: None }; t.x = Some(A(100.0)); println(fmt!("%?", t.x)); }
This should print Some(A(100f64)), but in 64-bit host (to be exact, x86_64-unknown-linux-gnu) this results in Some(A(0f64)) and behaves like that. Confirmed in 0.8 and (AFAIK) pre-0.9.
Notes:
The function f is nothing to do with the example, but it somehow prohibits the inlining of Some().
Only f64 triggers this bug. f32 or i64 does not.
Only tuple-like struct exhibits this bug. struct A { y: f64 } or enum A { A(f64) } does not, and the latter can be used a workaround for this bug.
It bears some resemblance with #9719 but the connection is unclear.
The text was updated successfully, but these errors were encountered:
Ugh, it seems to be fixed in the master (I had mistaken pre-0.8 master results as pre-0.9 ones), and the current master does not have this problem. Sorry for mistake.
Minimal example:
This should print
Some(A(100f64))
, but in 64-bit host (to be exact,x86_64-unknown-linux-gnu
) this results inSome(A(0f64))
and behaves like that. Confirmed in 0.8and (AFAIK) pre-0.9.Notes:
f
is nothing to do with the example, but it somehow prohibits the inlining ofSome()
.f64
triggers this bug.f32
ori64
does not.struct A { y: f64 }
orenum A { A(f64) }
does not, and the latter can be used a workaround for this bug.It bears some resemblance with #9719 but the connection is unclear.
The text was updated successfully, but these errors were encountered: