Ident::with_empty_ctxt -> Ident::with_dummy_span

`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
This commit is contained in:
Vadim Petrochenkov
2019-08-11 02:20:18 +03:00
parent 67d6ce4206
commit 6cb28b6617
30 changed files with 77 additions and 77 deletions

View File

@@ -44,7 +44,7 @@ pub fn expand(
let const_ty = ecx.ty(span, TyKind::Tup(Vec::new()));
let const_body = ecx.expr_block(ecx.block(span, stmts));
let const_item =
ecx.item_const(span, Ident::with_empty_ctxt(kw::Underscore), const_ty, const_body);
ecx.item_const(span, Ident::with_dummy_span(kw::Underscore), const_ty, const_body);
// Return the original item and the new methods.
vec![Annotatable::Item(item), Annotatable::Item(const_item)]
@@ -120,7 +120,7 @@ impl AllocFnFactory<'_, '_> {
) -> P<Expr> {
match *ty {
AllocatorTy::Layout => {
let usize = self.cx.path_ident(self.span, Ident::with_empty_ctxt(sym::usize));
let usize = self.cx.path_ident(self.span, Ident::with_dummy_span(sym::usize));
let ty_usize = self.cx.ty_path(usize);
let size = ident();
let align = ident();
@@ -178,12 +178,12 @@ impl AllocFnFactory<'_, '_> {
}
fn usize(&self) -> P<Ty> {
let usize = self.cx.path_ident(self.span, Ident::with_empty_ctxt(sym::usize));
let usize = self.cx.path_ident(self.span, Ident::with_dummy_span(sym::usize));
self.cx.ty_path(usize)
}
fn ptr_u8(&self) -> P<Ty> {
let u8 = self.cx.path_ident(self.span, Ident::with_empty_ctxt(sym::u8));
let u8 = self.cx.path_ident(self.span, Ident::with_dummy_span(sym::u8));
let ty_u8 = self.cx.ty_path(u8);
self.cx.ty_ptr(self.span, ty_u8, Mutability::Mutable)
}