]> git.lizzy.rs Git - rust.git/commit
auto merge of #19411 : lifthrasiir/rust/asm-clobbers-expanded, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 30 Nov 2014 17:21:48 +0000 (17:21 +0000)
committerbors <bors@rust-lang.org>
Sun, 30 Nov 2014 17:21:48 +0000 (17:21 +0000)
commit3ee471cab5ed17b14484c636c02d95fa1699e76f
treec25d47d9b3f73697072fac3d96e53b37c244c3dc
parent52888a7c47ce409fc80e56430056701d7349d27e
parent133266f01ca6bd1a75cdb0887c3c9f6ea500795f
auto merge of #19411 : lifthrasiir/rust/asm-clobbers-expanded, r=alexcrichton

I.e. we should not prematurely build operand constraints at the expansion time. Otherwise `--pretty expanded` diverges:

```
$ cat t.rs
#![feature(asm)]

pub fn main() { unsafe { asm!("" : : : "hello", "world") }; }

$ rustc t.rs --pretty
#![feature(asm)]

pub fn main() { unsafe { asm!("" : : : "hello" , "world") }; }

$ rustc t.rs --pretty expanded
#![feature(asm)]
#![feature(phase)]
#![no_std]
#![feature(globs)]
#[phase(plugin, link)]
extern crate "std" as std;
#[prelude_import]
use std::prelude::*;

pub fn main() { unsafe { asm!("":  :  : "~{hello},~{world}") }; }
```

(The last code *does* compile, but won't do the expected thing.)