summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorCensoredUsername <cens.username@gmail.com>2016-07-06 14:54:31 +0200
committerCensoredUsername <cens.username@gmail.com>2016-07-06 15:02:49 +0200
commite32da1275300a437490dd2e37ec49d7f11e3d780 (patch)
tree2fae7f4ab85685381325cfb12d81dceb0549d7ae /src/libsyntax_ext
parent47380768e7debc2ee6b66e491733b89534e80988 (diff)
downloadrust-e32da1275300a437490dd2e37ec49d7f11e3d780.tar.gz
rust-e32da1275300a437490dd2e37ec49d7f11e3d780.zip
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.
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/asm.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax_ext/asm.rs b/src/libsyntax_ext/asm.rs
index 56a8c28ffed..9cf45606238 100644
--- a/src/libsyntax_ext/asm.rs
+++ b/src/libsyntax_ext/asm.rs
@@ -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);
                 }
             }