diff options
| author | Keegan McAllister <kmcallister@mozilla.com> | 2014-09-27 01:33:36 -0700 |
|---|---|---|
| committer | Keegan McAllister <kmcallister@mozilla.com> | 2014-09-27 11:10:37 -0700 |
| commit | 9d60de93e2c5af1b69201b5e3bcf8943ae5df664 (patch) | |
| tree | b9e70d905c974cb3d6260867089ef1a13fd26df7 /src/libsyntax/ext | |
| parent | 34dfa45718d9d40361dadf0abf9c3dc5cc0b0381 (diff) | |
| download | rust-9d60de93e2c5af1b69201b5e3bcf8943ae5df664.tar.gz rust-9d60de93e2c5af1b69201b5e3bcf8943ae5df664.zip | |
Translate inline assembly errors back to source locations
Fixes #17552.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/asm.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index 4b8c3376cad..f82fe4b13a2 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -13,6 +13,7 @@ */ use ast; +use codemap; use codemap::Span; use ext::base; use ext::base::*; @@ -198,6 +199,15 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) } } + let codemap::ExpnId(expn_id) = cx.codemap().record_expansion(codemap::ExpnInfo { + call_site: sp, + callee: codemap::NameAndSpan { + name: "asm".to_string(), + format: codemap::MacroBang, + span: None, + }, + }); + MacExpr::new(P(ast::Expr { id: ast::DUMMY_NODE_ID, node: ast::ExprInlineAsm(ast::InlineAsm { @@ -208,7 +218,8 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) clobbers: token::intern_and_get_ident(cons.as_slice()), volatile: volatile, alignstack: alignstack, - dialect: dialect + dialect: dialect, + expn_id: expn_id, }), span: sp })) |
