diff options
| author | CensoredUsername <cens.username@gmail.com> | 2016-07-06 14:54:31 +0200 |
|---|---|---|
| committer | CensoredUsername <cens.username@gmail.com> | 2016-07-06 15:02:49 +0200 |
| commit | e32da1275300a437490dd2e37ec49d7f11e3d780 (patch) | |
| tree | 2fae7f4ab85685381325cfb12d81dceb0549d7ae /src/libsyntax_ext | |
| parent | 47380768e7debc2ee6b66e491733b89534e80988 (diff) | |
| download | rust-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.rs | 3 |
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); } } |
