Correct inline assembly clobber formatting.
Fixes the formatting for inline assembly clobbers used in the book. As this causes llvm to silently ignore the clobber an error is also added to catch cases in which the wrong formatting was used. Additionally a test case is added to confirm that this error works.
This commit is contained in:
@@ -192,7 +192,10 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[tokenstream::Token
|
||||
|
||||
if OPTIONS.iter().any(|&opt| s == opt) {
|
||||
cx.span_warn(p.last_span, "expected a clobber, found an option");
|
||||
} else if s.starts_with("{") || s.ends_with("}") {
|
||||
cx.span_err(p.last_span, "clobber should not be surrounded by braces");
|
||||
}
|
||||
|
||||
clobs.push(s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user