We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A little example code:
#![feature(asm)] #[allow(unused_variables, unused_mut, unused_assignments)] fn foo(a: u64, b: u64, x: u64) -> u64 { let mut w: u64; let mut result: u64; unsafe { asm!("mulq $3; divq $4;" : "=&{ax}"(w), "=&{dx}"(result) : "{ax}"(a), "r"(b), "r"(x) ); } result } fn main() { foo(1, 2, 3); }
Compiles and runs with no arguments:
...>rustc test.rs
But gives an error with two-phase-borrows:
...>rustc -Z borrowck=mir -Z two-phase-borrows test.rs error[E0381]: use of possibly uninitialized variable: `result` --> test.rs:14:5 | 14 | result | ^^^^^^ use of possibly uninitialized `result`
rustc 1.24.0-nightly (77efd6800 2017-12-15) host: x86_64-pc-windows-gnu
The text was updated successfully, but these errors were encountered:
Duplicate of #45695 - ASM statements are broken in moveck & MIR borrowck.
Sorry, something went wrong.
No branches or pull requests
A little example code:
Compiles and runs with no arguments:
...>rustc test.rs
But gives an error with two-phase-borrows:
The text was updated successfully, but these errors were encountered: