Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit da3ad47

Browse files
committedMar 25, 2017
Merge ExpnId and SyntaxContext.
1 parent 074a3c4 commit da3ad47

File tree

45 files changed

+454
-701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+454
-701
lines changed
 

‎src/librustc/hir/lowering.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ use std::mem;
5757
use syntax::attr;
5858
use syntax::ast::*;
5959
use syntax::errors;
60+
use syntax::ext::hygiene::{Mark, SyntaxContext};
6061
use syntax::ptr::P;
6162
use syntax::codemap::{self, respan, Spanned};
6263
use syntax::std_inject;
@@ -392,14 +393,16 @@ impl<'a> LoweringContext<'a> {
392393
}
393394

394395
fn allow_internal_unstable(&self, reason: &'static str, mut span: Span) -> Span {
395-
span.expn_id = self.sess.codemap().record_expansion(codemap::ExpnInfo {
396+
let mark = Mark::fresh();
397+
mark.set_expn_info(codemap::ExpnInfo {
396398
call_site: span,
397399
callee: codemap::NameAndSpan {
398400
format: codemap::CompilerDesugaring(Symbol::intern(reason)),
399401
span: Some(span),
400402
allow_internal_unstable: true,
401403
},
402404
});
405+
span.ctxt = SyntaxContext::empty().apply_mark(mark);
403406
span
404407
}
405408

@@ -1998,7 +2001,7 @@ impl<'a> LoweringContext<'a> {
19982001
volatile: asm.volatile,
19992002
alignstack: asm.alignstack,
20002003
dialect: asm.dialect,
2001-
expn_id: asm.expn_id,
2004+
ctxt: asm.ctxt,
20022005
};
20032006
let outputs =
20042007
asm.outputs.iter().map(|out| self.lower_expr(&out.expr)).collect();

‎src/librustc/hir/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ use hir::def::Def;
3333
use hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
3434
use util::nodemap::{NodeMap, FxHashSet};
3535

36-
use syntax_pos::{Span, ExpnId, DUMMY_SP};
36+
use syntax_pos::{Span, DUMMY_SP};
3737
use syntax::codemap::{self, Spanned};
3838
use syntax::abi::Abi;
3939
use syntax::ast::{Ident, Name, NodeId, DUMMY_NODE_ID, AsmDialect};
4040
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem};
41+
use syntax::ext::hygiene::SyntaxContext;
4142
use syntax::ptr::P;
4243
use syntax::symbol::{Symbol, keywords};
4344
use syntax::tokenstream::TokenStream;
@@ -1363,7 +1364,7 @@ pub struct InlineAsm {
13631364
pub volatile: bool,
13641365
pub alignstack: bool,
13651366
pub dialect: AsmDialect,
1366-
pub expn_id: ExpnId,
1367+
pub ctxt: SyntaxContext,
13671368
}
13681369

13691370
/// represents an argument in a function header

0 commit comments

Comments
 (0)
Please sign in to comment.