Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #49675

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9942012
Run make tests for file resolution
chmanchester Mar 27, 2018
d2b9a77
check impl trait first
tinaun Mar 3, 2018
97e0dc3
added test
tinaun Mar 3, 2018
bd81547
Take the original extra-filename passed to a crate into account when
chmanchester Mar 13, 2018
cd09c2b
Flush executables to disk after linkage
nabijaczleweli Mar 27, 2018
3787106
Also protect first attempt
nabijaczleweli Mar 29, 2018
e1d3c47
Open the file as write before trying to flush it
nabijaczleweli Mar 31, 2018
68b54a5
add a dist-thumb builder to build rust-std for the THUMB targets
japaric Apr 1, 2018
2a99c02
add new image to .travis.yml
japaric Apr 1, 2018
cc939ac
Add vec![ptr::null{,_mut}(); n] optimization, like vec![0; n]
glandium Mar 30, 2018
0df837f
Add vec!['\0'; n] optimization, like vec![0; n]
glandium Apr 2, 2018
f886518
std: Minimize size of panicking on wasm
alexcrichton Mar 29, 2018
138472b
Checking location and syntax of non_exhaustive attribute.
davidtwco Mar 24, 2018
d069354
merge dist-various-3 into dist-various-1
japaric Apr 3, 2018
862c839
extend no-std-ness check to all *-none-* targets
japaric Apr 3, 2018
21641d6
Refactor inner function into closure.
leoyvens Mar 26, 2018
ba5a5cf
Remove single use helper function.
leoyvens Mar 27, 2018
0a3eb5c
Simplify code around expected argument types.
leoyvens Mar 27, 2018
14768f9
create a nostd crate
japaric Apr 4, 2018
bca569f
Revert "create a nostd crate"
japaric Apr 4, 2018
b1015f5
compile other no-std crates
japaric Apr 4, 2018
1b1df3e
Use `Span` instead of `SyntaxContext` in `Ident`
petrochenkov Mar 17, 2018
8cde9ad
Rename `PathSegment::identifier` to `ident`
petrochenkov Mar 18, 2018
2e622b1
Get rid of `SpannedIdent`
petrochenkov Mar 18, 2018
1f4c139
Use `Span::apply_mark` where possible
petrochenkov Mar 18, 2018
179c9f1
Rename `ast::Variant_::name` into `ident` + Fix rebase
petrochenkov Mar 18, 2018
2dcafc4
Remove more duplicated spans
petrochenkov Mar 19, 2018
2c8eb34
Make lifetime nonterminals closer to identifier nonterminals
petrochenkov Mar 24, 2018
2bb74f6
Fix stable hash for identifiers
petrochenkov Mar 24, 2018
8a82a76
Use `Ident` instead of `Name` in `MetaItem`
petrochenkov Mar 24, 2018
eba1218
Fix feature gating for crate/extern in paths
petrochenkov Mar 25, 2018
1a2a234
Stabilize attributes on generic parameters
petrochenkov Mar 8, 2018
81e4ea1
Rollup merge of #48709 - tinaun:issue48703, r=nikomatsakis
alexcrichton Apr 5, 2018
c887c22
Rollup merge of #48851 - petrochenkov:genparattr, r=nikomatsakis
alexcrichton Apr 5, 2018
0afb655
Rollup merge of #49154 - petrochenkov:spident, r=eddyb
alexcrichton Apr 5, 2018
ab7bb51
Rollup merge of #49253 - chmanchester:probing_fix, r=alexcrichton
alexcrichton Apr 5, 2018
07e06ad
Rollup merge of #49345 - davidtwco:issue-44109, r=nikomatsakis
alexcrichton Apr 5, 2018
2d9e754
Rollup merge of #49419 - leodasvacas:small-typeck-refactorings, r=nik…
alexcrichton Apr 5, 2018
59053aa
Rollup merge of #49432 - nabijaczleweli:master, r=michaelwoerister
alexcrichton Apr 5, 2018
7432273
Rollup merge of #49488 - alexcrichton:small-wasm-panic, r=sfackler
alexcrichton Apr 5, 2018
1191bb1
Rollup merge of #49496 - glandium:master, r=sfackler
alexcrichton Apr 5, 2018
f8e3584
Rollup merge of #49563 - japaric:std-thumb, r=alexcrichton
alexcrichton Apr 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Span instead of SyntaxContext in Ident
  • Loading branch information
petrochenkov committed Apr 4, 2018
commit 1b1df3efc7fc99b366c968a8005cc88eb2b47f0a
2 changes: 1 addition & 1 deletion src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ impl TokenTree {
}).into();
},
TokenNode::Term(symbol) => {
let ident = ast::Ident { name: symbol.0, ctxt: self.span.0.ctxt() };
let ident = ast::Ident::new(symbol.0, self.span.0);
let sym_str = symbol.0.as_str();
let token =
if sym_str.starts_with("'") { Lifetime(ident) }
Expand Down
7 changes: 2 additions & 5 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ impl<'a> LoweringContext<'a> {

fn lower_ident(&mut self, ident: Ident) -> Name {
let ident = ident.modern();
if ident.ctxt == SyntaxContext::empty() {
if ident.span.ctxt() == SyntaxContext::empty() {
return ident.name;
}
*self.name_map
Expand Down Expand Up @@ -2089,10 +2089,7 @@ impl<'a> LoweringContext<'a> {
name: self.lower_ident(match f.ident {
Some(ident) => ident,
// FIXME(jseyfried) positional field hygiene
None => Ident {
name: Symbol::intern(&index.to_string()),
ctxt: f.span.ctxt(),
},
None => Ident::new(Symbol::intern(&index.to_string()), f.span),
}),
vis: self.lower_visibility(&f.vis, None),
ty: self.lower_ty(&f.ty, ImplTraitContext::Disallowed),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/impls_hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for ast::Ident {
hasher: &mut StableHasher<W>) {
let ast::Ident {
ref name,
ctxt: _ // Ignore this
span: _ // Ignore this
} = *self;

name.hash_stable(hcx, hasher);
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2088,8 +2088,8 @@ impl<'a, 'gcx, 'tcx> VariantDef {
return Some(index);
}
let mut ident = name.to_ident();
while ident.ctxt != SyntaxContext::empty() {
ident.ctxt.remove_mark();
while ident.span.ctxt() != SyntaxContext::empty() {
ident.span.remove_mark();
if let Some(field) = self.fields.iter().position(|f| f.name.to_ident() == ident) {
return Some(field);
}
Expand Down Expand Up @@ -2558,7 +2558,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
LOCAL_CRATE => self.hir.definitions().expansion(scope.index),
_ => Mark::root(),
};
let scope = match ident.ctxt.adjust(expansion) {
let scope = match ident.span.adjust(expansion) {
Some(macro_def) => self.hir.definitions().macro_def_scope(macro_def),
None if block == DUMMY_NODE_ID => DefId::local(CRATE_DEF_INDEX), // Dummy DefId
None => self.hir.get_module_parent(block),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_driver/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,11 @@ impl<'a> PrinterSupport for HygieneAnnotation<'a> {
impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
fn post(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
match node {
pprust::NodeIdent(&ast::Ident { name, ctxt }) => {
pprust::NodeIdent(&ast::Ident { name, span }) => {
s.s.space()?;
// FIXME #16420: this doesn't display the connections
// between syntax contexts
s.synth_comment(format!("{}{:?}", name.as_u32(), ctxt))
s.synth_comment(format!("{}{:?}", name.as_u32(), span.ctxt()))
}
pprust::NodeName(&name) => {
s.s.space()?;
Expand Down
13 changes: 6 additions & 7 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use rustc::util::nodemap::NodeSet;
use syntax::ast::{self, CRATE_NODE_ID, Ident};
use syntax::symbol::keywords;
use syntax_pos::Span;
use syntax_pos::hygiene::SyntaxContext;

use std::cmp;
use std::mem::replace;
Expand Down Expand Up @@ -495,11 +494,11 @@ struct NamePrivacyVisitor<'a, 'tcx: 'a> {
impl<'a, 'tcx> NamePrivacyVisitor<'a, 'tcx> {
// Checks that a field in a struct constructor (expression or pattern) is accessible.
fn check_field(&mut self,
use_ctxt: SyntaxContext, // Syntax context of the field name at the use site
use_ctxt: Span, // Syntax context of the field name at the use site
span: Span, // Span of the field pattern, e.g. `x: 0`
def: &'tcx ty::AdtDef, // Definition of the struct or enum
field: &'tcx ty::FieldDef) { // Definition of the field
let ident = Ident { ctxt: use_ctxt.modern(), ..keywords::Invalid.ident() };
let ident = Ident::new(keywords::Invalid.name(), use_ctxt.modern());
let def_id = self.tcx.adjust_ident(ident, def.did, self.current_item).1;
if !def.is_enum() && !field.vis.is_accessible_from(def_id, self.tcx) {
struct_span_err!(self.tcx.sess, span, E0451, "field `{}` of {} `{}` is private",
Expand Down Expand Up @@ -573,14 +572,14 @@ impl<'a, 'tcx> Visitor<'tcx> for NamePrivacyVisitor<'a, 'tcx> {
for variant_field in &variant.fields {
let field = fields.iter().find(|f| f.name.node == variant_field.name);
let (use_ctxt, span) = match field {
Some(field) => (field.name.node.to_ident().ctxt, field.span),
None => (base.span.ctxt(), base.span),
Some(field) => (field.name.node.to_ident().span, field.span),
None => (base.span, base.span),
};
self.check_field(use_ctxt, span, adt, variant_field);
}
} else {
for field in fields {
let use_ctxt = field.name.node.to_ident().ctxt;
let use_ctxt = field.name.node.to_ident().span;
let field_def = variant.field_named(field.name.node);
self.check_field(use_ctxt, field.span, adt, field_def);
}
Expand All @@ -599,7 +598,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NamePrivacyVisitor<'a, 'tcx> {
let adt = self.tables.pat_ty(pat).ty_adt_def().unwrap();
let variant = adt.variant_of_def(def);
for field in fields {
let use_ctxt = field.node.name.to_ident().ctxt;
let use_ctxt = field.node.name.to_ident().span;
let field_def = variant.field_named(field.node.name);
self.check_field(use_ctxt, field.span, adt, field_def);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<'a> Resolver<'a> {

// Disallow `use $crate;`
if source.name == keywords::DollarCrate.name() && path.segments.len() == 1 {
let crate_root = self.resolve_crate_root(source.ctxt, true);
let crate_root = self.resolve_crate_root(source.span.ctxt(), true);
let crate_name = match crate_root.kind {
ModuleKind::Def(_, name) => name,
ModuleKind::Block(..) => unreachable!(),
Expand Down
53 changes: 27 additions & 26 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1911,10 +1911,11 @@ impl<'a> Resolver<'a> {
path_span: Span)
-> Option<LexicalScopeBinding<'a>> {
if ns == TypeNS {
ident.ctxt = if ident.name == keywords::SelfType.name() {
SyntaxContext::empty() // FIXME(jseyfried) improve `Self` hygiene
ident.span = if ident.name == keywords::SelfType.name() {
// FIXME(jseyfried) improve `Self` hygiene
ident.span.with_ctxt(SyntaxContext::empty())
} else {
ident.ctxt.modern()
ident.span.modern()
}
}

Expand All @@ -1930,10 +1931,10 @@ impl<'a> Resolver<'a> {

module = match self.ribs[ns][i].kind {
ModuleRibKind(module) => module,
MacroDefinition(def) if def == self.macro_def(ident.ctxt) => {
MacroDefinition(def) if def == self.macro_def(ident.span.ctxt()) => {
// If an invocation of this macro created `ident`, give up on `ident`
// and switch to `ident`'s source from the macro definition.
ident.ctxt.remove_mark();
ident.span.remove_mark();
continue
}
_ => continue,
Expand All @@ -1953,9 +1954,9 @@ impl<'a> Resolver<'a> {
}
}

ident.ctxt = ident.ctxt.modern();
ident.span = ident.span.modern();
loop {
module = unwrap_or!(self.hygienic_lexical_parent(module, &mut ident.ctxt), break);
module = unwrap_or!(self.hygienic_lexical_parent(module, &mut ident.span), break);
let orig_current_module = self.current_module;
self.current_module = module; // Lexical resolutions can never be a privacy error.
let result = self.resolve_ident_in_module_unadjusted(
Expand All @@ -1979,10 +1980,10 @@ impl<'a> Resolver<'a> {
}
}

fn hygienic_lexical_parent(&mut self, mut module: Module<'a>, ctxt: &mut SyntaxContext)
fn hygienic_lexical_parent(&mut self, mut module: Module<'a>, span: &mut Span)
-> Option<Module<'a>> {
if !module.expansion.is_descendant_of(ctxt.outer()) {
return Some(self.macro_def_scope(ctxt.remove_mark()));
if !module.expansion.is_descendant_of(span.ctxt().outer()) {
return Some(self.macro_def_scope(span.remove_mark()));
}

if let ModuleKind::Block(..) = module.kind {
Expand All @@ -1994,7 +1995,7 @@ impl<'a> Resolver<'a> {
let parent_expansion = parent.expansion.modern();
if module_expansion.is_descendant_of(parent_expansion) &&
parent_expansion != module_expansion {
return if parent_expansion.is_descendant_of(ctxt.outer()) {
return if parent_expansion.is_descendant_of(span.ctxt().outer()) {
Some(parent)
} else {
None
Expand All @@ -2015,9 +2016,9 @@ impl<'a> Resolver<'a> {
record_used: bool,
span: Span)
-> Result<&'a NameBinding<'a>, Determinacy> {
ident.ctxt = ident.ctxt.modern();
ident.span = ident.span.modern();
let orig_current_module = self.current_module;
if let Some(def) = ident.ctxt.adjust(module.expansion) {
if let Some(def) = ident.span.adjust(module.expansion) {
self.current_module = self.macro_def_scope(def);
}
let result = self.resolve_ident_in_module_unadjusted(
Expand Down Expand Up @@ -2107,8 +2108,8 @@ impl<'a> Resolver<'a> {
// If an invocation of this macro created `ident`, give up on `ident`
// and switch to `ident`'s source from the macro definition.
MacroDefinition(def) => {
if def == self.macro_def(ident.ctxt) {
ident.ctxt.remove_mark();
if def == self.macro_def(ident.span.ctxt()) {
ident.span.remove_mark();
}
}
_ => {
Expand Down Expand Up @@ -2872,7 +2873,7 @@ impl<'a> Resolver<'a> {
}
if path.len() == 1 && this.self_type_is_available(span) {
if let Some(candidate) = this.lookup_assoc_candidate(ident.node, ns, is_expected) {
let self_is_available = this.self_value_is_available(path[0].node.ctxt, span);
let self_is_available = this.self_value_is_available(path[0].node.span, span);
match candidate {
AssocSuggestion::Field => {
err.span_suggestion(span, "try",
Expand Down Expand Up @@ -3083,9 +3084,9 @@ impl<'a> Resolver<'a> {
if let Some(LexicalScopeBinding::Def(def)) = binding { def != Def::Err } else { false }
}

fn self_value_is_available(&mut self, ctxt: SyntaxContext, span: Span) -> bool {
let ident = Ident { name: keywords::SelfValue.name(), ctxt: ctxt };
let binding = self.resolve_ident_in_lexical_scope(ident, ValueNS, false, span);
fn self_value_is_available(&mut self, self_span: Span, path_span: Span) -> bool {
let ident = Ident::new(keywords::SelfValue.name(), self_span);
let binding = self.resolve_ident_in_lexical_scope(ident, ValueNS, false, path_span);
if let Some(LexicalScopeBinding::Def(def)) = binding { def != Def::Err } else { false }
}

Expand Down Expand Up @@ -3218,11 +3219,11 @@ impl<'a> Resolver<'a> {
let name = ident.node.name;

if i == 0 && ns == TypeNS && name == keywords::SelfValue.name() {
let mut ctxt = ident.node.ctxt.modern();
let mut ctxt = ident.node.span.ctxt().modern();
module = Some(self.resolve_self(&mut ctxt, self.current_module));
continue
} else if allow_super && ns == TypeNS && name == keywords::Super.name() {
let mut ctxt = ident.node.ctxt.modern();
let mut ctxt = ident.node.span.ctxt().modern();
let self_module = match i {
0 => self.resolve_self(&mut ctxt, self.current_module),
_ => module.unwrap(),
Expand All @@ -3244,11 +3245,11 @@ impl<'a> Resolver<'a> {
(i == 1 && name == keywords::Crate.name() &&
path[0].node.name == keywords::CrateRoot.name()) {
// `::a::b` or `::crate::a::b`
module = Some(self.resolve_crate_root(ident.node.ctxt, false));
module = Some(self.resolve_crate_root(ident.node.span.ctxt(), false));
continue
} else if i == 0 && name == keywords::DollarCrate.name() {
// `$crate::a::b`
module = Some(self.resolve_crate_root(ident.node.ctxt, true));
module = Some(self.resolve_crate_root(ident.node.span.ctxt(), true));
continue
} else if i == 1 && !token::is_path_segment_keyword(ident.node) {
let prev_name = path[0].node.name;
Expand Down Expand Up @@ -3770,12 +3771,12 @@ impl<'a> Resolver<'a> {
}
}

ident.ctxt = ident.ctxt.modern();
ident.span = ident.span.modern();
let mut search_module = self.current_module;
loop {
self.get_traits_in_module_containing_item(ident, ns, search_module, &mut found_traits);
search_module =
unwrap_or!(self.hygienic_lexical_parent(search_module, &mut ident.ctxt), break);
unwrap_or!(self.hygienic_lexical_parent(search_module, &mut ident.span), break);
}

if let Some(prelude) = self.prelude {
Expand Down Expand Up @@ -3807,7 +3808,7 @@ impl<'a> Resolver<'a> {
for &(trait_name, binding) in traits.as_ref().unwrap().iter() {
let module = binding.module().unwrap();
let mut ident = ident;
if ident.ctxt.glob_adjust(module.expansion, binding.span.ctxt().modern()).is_none() {
if ident.span.glob_adjust(module.expansion, binding.span.ctxt().modern()).is_none() {
continue
}
if self.resolve_ident_in_module_unadjusted(module, ident, ns, false, false, module.span)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_resolve/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<'a> base::Resolver for Resolver<'a> {
let ident = path.segments[0].identifier;
if ident.name == keywords::DollarCrate.name() {
path.segments[0].identifier.name = keywords::CrateRoot.name();
let module = self.0.resolve_crate_root(ident.ctxt, true);
let module = self.0.resolve_crate_root(ident.span.ctxt(), true);
if !module.is_local() {
let span = path.segments[0].span;
path.segments.insert(1, match module.kind {
Expand Down Expand Up @@ -534,7 +534,7 @@ impl<'a> Resolver<'a> {
}

module = match module {
Some(module) => self.hygienic_lexical_parent(module, &mut ident.ctxt),
Some(module) => self.hygienic_lexical_parent(module, &mut ident.span),
None => return potential_illegal_shadower,
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl<'a> Resolver<'a> {
}
let module = unwrap_or!(directive.imported_module.get(), return Err(Undetermined));
let (orig_current_module, mut ident) = (self.current_module, ident.modern());
match ident.ctxt.glob_adjust(module.expansion, directive.span.ctxt().modern()) {
match ident.span.glob_adjust(module.expansion, directive.span.ctxt().modern()) {
Some(Some(def)) => self.current_module = self.macro_def_scope(def),
Some(None) => {}
None => continue,
Expand Down Expand Up @@ -398,7 +398,7 @@ impl<'a> Resolver<'a> {
// Define `binding` in `module`s glob importers.
for directive in module.glob_importers.borrow_mut().iter() {
let mut ident = ident.modern();
let scope = match ident.ctxt.reverse_glob_adjust(module.expansion,
let scope = match ident.span.reverse_glob_adjust(module.expansion,
directive.span.ctxt().modern()) {
Some(Some(def)) => self.macro_def_scope(def),
Some(None) => directive.parent,
Expand Down Expand Up @@ -623,7 +623,7 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
"crate root imports need to be explicitly named: \
`use crate as name;`".to_string()));
} else {
Some(self.resolve_crate_root(source.ctxt.modern(), false))
Some(self.resolve_crate_root(source.span.ctxt().modern(), false))
}
} else if is_extern && !token::is_path_segment_keyword(source) {
let crate_id =
Expand Down Expand Up @@ -860,7 +860,7 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
resolution.borrow().binding().map(|binding| (ident, binding))
}).collect::<Vec<_>>();
for ((mut ident, ns), binding) in bindings {
let scope = match ident.ctxt.reverse_glob_adjust(module.expansion,
let scope = match ident.span.reverse_glob_adjust(module.expansion,
directive.span.ctxt().modern()) {
Some(Some(def)) => self.macro_def_scope(def),
Some(None) => self.current_module,
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3213,10 +3213,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
if !tuple_like { continue }

debug!("tuple struct named {:?}", base_t);
let ident = ast::Ident {
name: Symbol::intern(&idx.node.to_string()),
ctxt: idx.span.ctxt().modern(),
};
let ident =
ast::Ident::new(Symbol::intern(&idx.node.to_string()), idx.span.modern());
let (ident, def_scope) =
self.tcx.adjust_ident(ident, base_def.did, self.body_id);
let fields = &base_def.non_enum_variant().fields;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl PathSegment {
}
pub fn crate_root(span: Span) -> Self {
PathSegment {
identifier: Ident { ctxt: span.ctxt(), ..keywords::CrateRoot.ident() },
identifier: Ident::new(keywords::CrateRoot.name(), span),
span,
parameters: None,
}
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ impl<'a> ExtCtxt<'a> {
ast::Ident::from_str(st)
}
pub fn std_path(&self, components: &[&str]) -> Vec<ast::Ident> {
let def_site = SyntaxContext::empty().apply_mark(self.current_expansion.mark);
iter::once(Ident { ctxt: def_site, ..keywords::DollarCrate.ident() })
let def_site = DUMMY_SP.apply_mark(self.current_expansion.mark);
iter::once(Ident::new(keywords::DollarCrate.name(), def_site))
.chain(components.iter().map(|s| self.ident_of(s)))
.collect()
}
Expand Down
Loading