|
|
|
|
|
by tialaramex
9 days ago
|
|
> Nope that's incorrect. https://rust.godbolt.org/z/nxnazs7Y6 c and d are both integers. Do you agree? When you follow this link they'll have arbitrary values so I can't predict what those values will be but I can tell you that they'll be identical because the optimising compiler put both those unused temporary locals in the same spot on the stack. One and three are booleans which ask whether the pointers to those temporaries are the same, LLVM says they are not even though Rust's policy is that they are. That's not great, but we could choose to imagine that's a Rust bug, except... Two is another boolean asking whether the integers c and d are the same. LLVM says that those aren't the same either. It has given provenance to integers, that's the bug. |
|