Auto merge of #23655 - gereeter:rustc-remove-ident, r=sanxiyn
...of #6993. cc @pcwalton
This commit is contained in:
commit
aab8669dda
@ -763,7 +763,7 @@ pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::Nod
|
||||
let arg_tys = get_struct_fields(intr.clone(), cdata, did.node)
|
||||
.iter()
|
||||
.map(|field_ty| {
|
||||
arg_names.push(ast::Ident::new(field_ty.name));
|
||||
arg_names.push(field_ty.name);
|
||||
get_type(cdata, field_ty.id.node, tcx).ty
|
||||
})
|
||||
.collect();
|
||||
|
@ -87,8 +87,8 @@ fn encode_name(rbml_w: &mut Encoder, name: ast::Name) {
|
||||
rbml_w.wr_tagged_str(tag_paths_data_name, &token::get_name(name));
|
||||
}
|
||||
|
||||
fn encode_impl_type_basename(rbml_w: &mut Encoder, name: ast::Ident) {
|
||||
rbml_w.wr_tagged_str(tag_item_impl_type_basename, &token::get_ident(name));
|
||||
fn encode_impl_type_basename(rbml_w: &mut Encoder, name: ast::Name) {
|
||||
rbml_w.wr_tagged_str(tag_item_impl_type_basename, &token::get_name(name));
|
||||
}
|
||||
|
||||
pub fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
|
||||
@ -519,12 +519,12 @@ fn encode_info_for_mod(ecx: &EncodeContext,
|
||||
attrs: &[ast::Attribute],
|
||||
id: NodeId,
|
||||
path: PathElems,
|
||||
name: ast::Ident,
|
||||
name: ast::Name,
|
||||
vis: ast::Visibility) {
|
||||
rbml_w.start_tag(tag_items_data_item);
|
||||
encode_def_id(rbml_w, local_def(id));
|
||||
encode_family(rbml_w, 'm');
|
||||
encode_name(rbml_w, name.name);
|
||||
encode_name(rbml_w, name);
|
||||
debug!("(encoding info for module) encoding info for module ID {}", id);
|
||||
|
||||
// Encode info about all the module children.
|
||||
@ -666,7 +666,7 @@ fn encode_info_for_struct(ecx: &EncodeContext,
|
||||
|
||||
fn encode_info_for_struct_ctor(ecx: &EncodeContext,
|
||||
rbml_w: &mut Encoder,
|
||||
name: ast::Ident,
|
||||
name: ast::Name,
|
||||
ctor_id: NodeId,
|
||||
index: &mut Vec<entry<i64>>,
|
||||
struct_id: NodeId) {
|
||||
@ -679,7 +679,7 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
|
||||
encode_def_id(rbml_w, local_def(ctor_id));
|
||||
encode_family(rbml_w, 'o');
|
||||
encode_bounds_and_type_for_item(rbml_w, ecx, ctor_id);
|
||||
encode_name(rbml_w, name.name);
|
||||
encode_name(rbml_w, name);
|
||||
ecx.tcx.map.with_path(ctor_id, |path| encode_path(rbml_w, path));
|
||||
encode_parent_item(rbml_w, local_def(struct_id));
|
||||
|
||||
@ -886,7 +886,7 @@ fn encode_method_argument_names(rbml_w: &mut Encoder,
|
||||
for arg in &decl.inputs {
|
||||
let tag = tag_method_argument_name;
|
||||
if let ast::PatIdent(_, ref path1, _) = arg.pat.node {
|
||||
let name = token::get_ident(path1.node);
|
||||
let name = token::get_name(path1.node.name);
|
||||
rbml_w.wr_tagged_bytes(tag, name.as_bytes());
|
||||
} else {
|
||||
rbml_w.wr_tagged_bytes(tag, &[]);
|
||||
@ -1044,7 +1044,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||
&item.attrs,
|
||||
item.id,
|
||||
path,
|
||||
item.ident,
|
||||
item.ident.name,
|
||||
item.vis);
|
||||
}
|
||||
ast::ItemForeignMod(ref fm) => {
|
||||
@ -1152,7 +1152,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||
// If this is a tuple-like struct, encode the type of the constructor.
|
||||
match struct_def.ctor_id {
|
||||
Some(ctor_id) => {
|
||||
encode_info_for_struct_ctor(ecx, rbml_w, item.ident,
|
||||
encode_info_for_struct_ctor(ecx, rbml_w, item.ident.name,
|
||||
ctor_id, index, def_id.node);
|
||||
}
|
||||
None => {}
|
||||
@ -1187,8 +1187,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||
encode_polarity(rbml_w, polarity);
|
||||
match ty.node {
|
||||
ast::TyPath(None, ref path) if path.segments.len() == 1 => {
|
||||
let ident = path.segments.last().unwrap().identifier;
|
||||
encode_impl_type_basename(rbml_w, ident);
|
||||
let name = path.segments.last().unwrap().identifier.name;
|
||||
encode_impl_type_basename(rbml_w, name);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@ -1513,7 +1513,7 @@ fn encode_info_for_items(ecx: &EncodeContext,
|
||||
&[],
|
||||
ast::CRATE_NODE_ID,
|
||||
[].iter().cloned().chain(LinkedPath::empty()),
|
||||
syntax::parse::token::special_idents::invalid,
|
||||
syntax::parse::token::special_idents::invalid.name,
|
||||
ast::Public);
|
||||
|
||||
visit::walk_crate(&mut EncodeVisitor {
|
||||
|
@ -101,10 +101,6 @@ fn scan<R, F, G>(st: &mut PState, mut is_last: F, op: G) -> R where
|
||||
return op(&st.data[start_pos..end_pos]);
|
||||
}
|
||||
|
||||
pub fn parse_ident(st: &mut PState, last: char) -> ast::Ident {
|
||||
ast::Ident::new(parse_name(st, last))
|
||||
}
|
||||
|
||||
pub fn parse_name(st: &mut PState, last: char) -> ast::Name {
|
||||
fn is_last(b: char, c: char) -> bool { return c == b; }
|
||||
parse_name_(st, |a| is_last(last, a) )
|
||||
|
@ -133,12 +133,12 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_field_access(&mut self, lhs: &ast::Expr, name: &ast::Ident) {
|
||||
fn handle_field_access(&mut self, lhs: &ast::Expr, name: ast::Name) {
|
||||
match ty::expr_ty_adjusted(self.tcx, lhs).sty {
|
||||
ty::ty_struct(id, _) => {
|
||||
let fields = ty::lookup_struct_fields(self.tcx, id);
|
||||
let field_id = fields.iter()
|
||||
.find(|field| field.name == name.name).unwrap().id;
|
||||
.find(|field| field.name == name).unwrap().id;
|
||||
self.live_symbols.insert(field_id.node);
|
||||
},
|
||||
_ => ()
|
||||
@ -267,7 +267,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
|
||||
self.lookup_and_handle_method(expr.id, expr.span);
|
||||
}
|
||||
ast::ExprField(ref lhs, ref ident) => {
|
||||
self.handle_field_access(&**lhs, &ident.node);
|
||||
self.handle_field_access(&**lhs, ident.node.name);
|
||||
}
|
||||
ast::ExprTupField(ref lhs, idx) => {
|
||||
self.handle_tup_field_access(&**lhs, idx.node);
|
||||
@ -511,9 +511,9 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
|
||||
fn warn_dead_code(&mut self,
|
||||
id: ast::NodeId,
|
||||
span: codemap::Span,
|
||||
ident: ast::Ident,
|
||||
name: ast::Name,
|
||||
node_type: &str) {
|
||||
let name = ident.as_str();
|
||||
let name = name.as_str();
|
||||
if !name.starts_with("_") {
|
||||
self.tcx
|
||||
.sess
|
||||
@ -528,14 +528,19 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
|
||||
impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
|
||||
fn visit_item(&mut self, item: &ast::Item) {
|
||||
if self.should_warn_about_item(item) {
|
||||
self.warn_dead_code(item.id, item.span, item.ident, item.node.descriptive_variant());
|
||||
self.warn_dead_code(
|
||||
item.id,
|
||||
item.span,
|
||||
item.ident.name,
|
||||
item.node.descriptive_variant()
|
||||
);
|
||||
} else {
|
||||
match item.node {
|
||||
ast::ItemEnum(ref enum_def, _) => {
|
||||
for variant in &enum_def.variants {
|
||||
if self.should_warn_about_variant(&variant.node) {
|
||||
self.warn_dead_code(variant.node.id, variant.span,
|
||||
variant.node.name, "variant");
|
||||
variant.node.name.name, "variant");
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -547,7 +552,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
|
||||
|
||||
fn visit_foreign_item(&mut self, fi: &ast::ForeignItem) {
|
||||
if !self.symbol_is_live(fi.id, None) {
|
||||
self.warn_dead_code(fi.id, fi.span, fi.ident, fi.node.descriptive_variant());
|
||||
self.warn_dead_code(fi.id, fi.span, fi.ident.name, fi.node.descriptive_variant());
|
||||
}
|
||||
visit::walk_foreign_item(self, fi);
|
||||
}
|
||||
@ -559,7 +564,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
|
||||
match fk {
|
||||
visit::FkMethod(name, _) => {
|
||||
if !self.symbol_is_live(id, None) {
|
||||
self.warn_dead_code(id, span, name, "method");
|
||||
self.warn_dead_code(id, span, name.name, "method");
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
@ -570,7 +575,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
|
||||
fn visit_struct_field(&mut self, field: &ast::StructField) {
|
||||
if self.should_warn_about_field(&field.node) {
|
||||
self.warn_dead_code(field.node.id, field.span,
|
||||
field.node.ident().unwrap(), "struct field");
|
||||
field.node.ident().unwrap().name, "struct field");
|
||||
}
|
||||
|
||||
visit::walk_struct_field(self, field);
|
||||
|
@ -248,12 +248,12 @@ struct CaptureInfo {
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
struct LocalInfo {
|
||||
id: NodeId,
|
||||
ident: ast::Ident
|
||||
name: ast::Name
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum VarKind {
|
||||
Arg(NodeId, ast::Ident),
|
||||
Arg(NodeId, ast::Name),
|
||||
Local(LocalInfo),
|
||||
ImplicitRet,
|
||||
CleanExit
|
||||
@ -334,8 +334,8 @@ impl<'a, 'tcx> IrMaps<'a, 'tcx> {
|
||||
|
||||
fn variable_name(&self, var: Variable) -> String {
|
||||
match self.var_kinds[var.get()] {
|
||||
Local(LocalInfo { ident: nm, .. }) | Arg(_, nm) => {
|
||||
token::get_ident(nm).to_string()
|
||||
Local(LocalInfo { name, .. }) | Arg(_, name) => {
|
||||
token::get_name(name).to_string()
|
||||
},
|
||||
ImplicitRet => "<implicit-ret>".to_string(),
|
||||
CleanExit => "<clean-exit>".to_string()
|
||||
@ -385,8 +385,8 @@ fn visit_fn(ir: &mut IrMaps,
|
||||
&*arg.pat,
|
||||
|_bm, arg_id, _x, path1| {
|
||||
debug!("adding argument {}", arg_id);
|
||||
let ident = path1.node;
|
||||
fn_maps.add_variable(Arg(arg_id, ident));
|
||||
let name = path1.node.name;
|
||||
fn_maps.add_variable(Arg(arg_id, name));
|
||||
})
|
||||
};
|
||||
|
||||
@ -418,11 +418,11 @@ fn visit_fn(ir: &mut IrMaps,
|
||||
fn visit_local(ir: &mut IrMaps, local: &ast::Local) {
|
||||
pat_util::pat_bindings(&ir.tcx.def_map, &*local.pat, |_, p_id, sp, path1| {
|
||||
debug!("adding local variable {}", p_id);
|
||||
let name = path1.node;
|
||||
let name = path1.node.name;
|
||||
ir.add_live_node_for_node(p_id, VarDefNode(sp));
|
||||
ir.add_variable(Local(LocalInfo {
|
||||
id: p_id,
|
||||
ident: name
|
||||
name: name
|
||||
}));
|
||||
});
|
||||
visit::walk_local(ir, local);
|
||||
@ -433,11 +433,11 @@ fn visit_arm(ir: &mut IrMaps, arm: &ast::Arm) {
|
||||
pat_util::pat_bindings(&ir.tcx.def_map, &**pat, |bm, p_id, sp, path1| {
|
||||
debug!("adding local variable {} from match with bm {:?}",
|
||||
p_id, bm);
|
||||
let name = path1.node;
|
||||
let name = path1.node.name;
|
||||
ir.add_live_node_for_node(p_id, VarDefNode(sp));
|
||||
ir.add_variable(Local(LocalInfo {
|
||||
id: p_id,
|
||||
ident: name
|
||||
name: name
|
||||
}));
|
||||
})
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ use std::vec::IntoIter;
|
||||
use collections::enum_set::{EnumSet, CLike};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::abi;
|
||||
use syntax::ast::{CrateNum, DefId, Ident, ItemTrait, LOCAL_CRATE};
|
||||
use syntax::ast::{CrateNum, DefId, ItemTrait, LOCAL_CRATE};
|
||||
use syntax::ast::{MutImmutable, MutMutable, Name, NamedField, NodeId};
|
||||
use syntax::ast::{StmtExpr, StmtSemi, StructField, UnnamedField, Visibility};
|
||||
use syntax::ast_util::{self, is_local, lit_is_str, local_def};
|
||||
@ -4361,8 +4361,8 @@ pub fn named_element_ty<'tcx>(cx: &ctxt<'tcx>,
|
||||
variant_info.arg_names.as_ref()
|
||||
.expect("must have struct enum variant if accessing a named fields")
|
||||
.iter().zip(variant_info.args.iter())
|
||||
.find(|&(ident, _)| ident.name == n)
|
||||
.map(|(_ident, arg_t)| arg_t.subst(cx, substs))
|
||||
.find(|&(&name, _)| name == n)
|
||||
.map(|(_name, arg_t)| arg_t.subst(cx, substs))
|
||||
}
|
||||
_ => None
|
||||
}
|
||||
@ -5341,7 +5341,7 @@ pub fn ty_to_def_id(ty: Ty) -> Option<ast::DefId> {
|
||||
#[derive(Clone)]
|
||||
pub struct VariantInfo<'tcx> {
|
||||
pub args: Vec<Ty<'tcx>>,
|
||||
pub arg_names: Option<Vec<ast::Ident>>,
|
||||
pub arg_names: Option<Vec<ast::Name>>,
|
||||
pub ctor_ty: Option<Ty<'tcx>>,
|
||||
pub name: ast::Name,
|
||||
pub id: ast::DefId,
|
||||
@ -5388,7 +5388,7 @@ impl<'tcx> VariantInfo<'tcx> {
|
||||
.map(|field| node_id_to_type(cx, field.node.id)).collect();
|
||||
let arg_names = fields.iter().map(|field| {
|
||||
match field.node.kind {
|
||||
NamedField(ident, _) => ident,
|
||||
NamedField(ident, _) => ident.name,
|
||||
UnnamedField(..) => cx.sess.bug(
|
||||
"enum_variants: all fields in struct must have a name")
|
||||
}
|
||||
|
@ -396,11 +396,11 @@ fn add_fragment_siblings_for_extension<'tcx>(this: &MoveData<'tcx>,
|
||||
match *origin_field_name {
|
||||
mc::NamedField(ast_name) => {
|
||||
let variant_arg_names = variant_info.arg_names.as_ref().unwrap();
|
||||
for variant_arg_ident in variant_arg_names {
|
||||
if variant_arg_ident.name == ast_name {
|
||||
for &variant_arg_name in variant_arg_names {
|
||||
if variant_arg_name == ast_name {
|
||||
continue;
|
||||
}
|
||||
let field_name = mc::NamedField(variant_arg_ident.name);
|
||||
let field_name = mc::NamedField(variant_arg_name);
|
||||
add_fragment_sibling_local(field_name, Some(variant_info.id));
|
||||
}
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
|
||||
fn check_static_method(&mut self,
|
||||
span: Span,
|
||||
method_id: ast::DefId,
|
||||
name: ast::Ident) {
|
||||
name: ast::Name) {
|
||||
// If the method is a default method, we need to use the def_id of
|
||||
// the default implementation.
|
||||
let method_id = match ty::impl_or_trait_item(self.tcx, method_id) {
|
||||
@ -696,7 +696,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
|
||||
ty::TypeTraitItem(_) => method_id,
|
||||
};
|
||||
|
||||
let string = token::get_ident(name);
|
||||
let string = token::get_name(name);
|
||||
self.report_error(self.ensure_public(span,
|
||||
method_id,
|
||||
None,
|
||||
@ -705,13 +705,13 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
|
||||
}
|
||||
|
||||
// Checks that a path is in scope.
|
||||
fn check_path(&mut self, span: Span, path_id: ast::NodeId, last: ast::Ident) {
|
||||
fn check_path(&mut self, span: Span, path_id: ast::NodeId, last: ast::Name) {
|
||||
debug!("privacy - path {}", self.nodestr(path_id));
|
||||
let path_res = *self.tcx.def_map.borrow().get(&path_id).unwrap();
|
||||
let ck = |tyname: &str| {
|
||||
let ck_public = |def: ast::DefId| {
|
||||
debug!("privacy - ck_public {:?}", def);
|
||||
let name = token::get_ident(last);
|
||||
let name = token::get_name(last);
|
||||
let origdid = path_res.def_id();
|
||||
self.ensure_public(span,
|
||||
def,
|
||||
@ -800,10 +800,10 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
|
||||
|
||||
// Checks that a method is in scope.
|
||||
fn check_method(&mut self, span: Span, origin: &MethodOrigin,
|
||||
ident: ast::Ident) {
|
||||
name: ast::Name) {
|
||||
match *origin {
|
||||
MethodStatic(method_id) => {
|
||||
self.check_static_method(span, method_id, ident)
|
||||
self.check_static_method(span, method_id, name)
|
||||
}
|
||||
MethodStaticClosure(_) => {}
|
||||
// Trait methods are always all public. The only controlling factor
|
||||
@ -825,11 +825,11 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
|
||||
match pid.node {
|
||||
ast::PathListIdent { id, name } => {
|
||||
debug!("privacy - ident item {}", id);
|
||||
self.check_path(pid.span, id, name);
|
||||
self.check_path(pid.span, id, name.name);
|
||||
}
|
||||
ast::PathListMod { id } => {
|
||||
debug!("privacy - mod item {}", id);
|
||||
let name = prefix.segments.last().unwrap().identifier;
|
||||
let name = prefix.segments.last().unwrap().identifier.name;
|
||||
self.check_path(pid.span, id, name);
|
||||
}
|
||||
}
|
||||
@ -863,7 +863,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
|
||||
}
|
||||
Some(method) => {
|
||||
debug!("(privacy checking) checking impl method");
|
||||
self.check_method(expr.span, &method.origin, ident.node);
|
||||
self.check_method(expr.span, &method.origin, ident.node.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1005,7 +1005,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
|
||||
}
|
||||
|
||||
fn visit_path(&mut self, path: &ast::Path, id: ast::NodeId) {
|
||||
self.check_path(path.span, id, path.segments.last().unwrap().identifier);
|
||||
self.check_path(path.span, id, path.segments.last().unwrap().identifier.name);
|
||||
visit::walk_path(self, path);
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
|
||||
|
||||
fn process_method(&mut self, sig: &ast::MethodSig,
|
||||
body: Option<&ast::Block>,
|
||||
id: ast::NodeId, ident: ast::Ident,
|
||||
id: ast::NodeId, name: ast::Name,
|
||||
span: Span) {
|
||||
if generated_code(span) {
|
||||
return;
|
||||
@ -354,7 +354,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
|
||||
},
|
||||
};
|
||||
|
||||
let qualname = &format!("{}::{}", qualname, &get_ident(ident));
|
||||
let qualname = &format!("{}::{}", qualname, &token::get_name(name));
|
||||
|
||||
// record the decl for this def (if it has one)
|
||||
let decl_id = ty::trait_item_of_item(&self.analysis.ty_cx,
|
||||
@ -1238,7 +1238,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
|
||||
match trait_item.node {
|
||||
ast::MethodTraitItem(ref sig, ref body) => {
|
||||
self.process_method(sig, body.as_ref().map(|x| &**x),
|
||||
trait_item.id, trait_item.ident, trait_item.span);
|
||||
trait_item.id, trait_item.ident.name, trait_item.span);
|
||||
}
|
||||
ast::TypeTraitItem(..) => {}
|
||||
}
|
||||
@ -1248,7 +1248,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
|
||||
match impl_item.node {
|
||||
ast::MethodImplItem(ref sig, ref body) => {
|
||||
self.process_method(sig, Some(body), impl_item.id,
|
||||
impl_item.ident, impl_item.span);
|
||||
impl_item.ident.name, impl_item.span);
|
||||
}
|
||||
ast::TypeImplItem(_) |
|
||||
ast::MacImplItem(_) => {}
|
||||
|
@ -223,7 +223,7 @@ use std::cmp::Ordering;
|
||||
use std::iter::AdditiveIterator;
|
||||
use std::rc::Rc;
|
||||
use syntax::ast;
|
||||
use syntax::ast::{DUMMY_NODE_ID, Ident, NodeId};
|
||||
use syntax::ast::{DUMMY_NODE_ID, NodeId};
|
||||
use syntax::codemap::Span;
|
||||
use syntax::fold::Folder;
|
||||
use syntax::ptr::P;
|
||||
@ -349,7 +349,7 @@ pub struct BindingInfo<'tcx> {
|
||||
pub ty: Ty<'tcx>,
|
||||
}
|
||||
|
||||
type BindingsMap<'tcx> = FnvHashMap<Ident, BindingInfo<'tcx>>;
|
||||
type BindingsMap<'tcx> = FnvHashMap<ast::Ident, BindingInfo<'tcx>>;
|
||||
|
||||
struct ArmData<'p, 'blk, 'tcx: 'blk> {
|
||||
bodycx: Block<'blk, 'tcx>,
|
||||
@ -364,7 +364,7 @@ struct ArmData<'p, 'blk, 'tcx: 'blk> {
|
||||
struct Match<'a, 'p: 'a, 'blk: 'a, 'tcx: 'blk> {
|
||||
pats: Vec<&'p ast::Pat>,
|
||||
data: &'a ArmData<'p, 'blk, 'tcx>,
|
||||
bound_ptrs: Vec<(Ident, ValueRef)>,
|
||||
bound_ptrs: Vec<(ast::Ident, ValueRef)>,
|
||||
// Thread along renamings done by the check_match::StaticInliner, so we can
|
||||
// map back to original NodeIds
|
||||
pat_renaming_map: Option<&'a FnvHashMap<(NodeId, Span), NodeId>>
|
||||
@ -923,7 +923,7 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
||||
|
||||
debug!("binding {} to {}", binding_info.id, bcx.val_to_string(llval));
|
||||
bcx.fcx.lllocals.borrow_mut().insert(binding_info.id, datum);
|
||||
debuginfo::create_match_binding_metadata(bcx, ident, binding_info);
|
||||
debuginfo::create_match_binding_metadata(bcx, ident.name, binding_info);
|
||||
}
|
||||
bcx
|
||||
}
|
||||
@ -1380,6 +1380,7 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &ast::Pat,
|
||||
let mut bindings_map = FnvHashMap();
|
||||
pat_bindings(&tcx.def_map, &*pat, |bm, p_id, span, path1| {
|
||||
let ident = path1.node;
|
||||
let name = ident.name;
|
||||
let variable_ty = node_id_type(bcx, p_id);
|
||||
let llvariable_ty = type_of::type_of(ccx, variable_ty);
|
||||
let tcx = bcx.tcx();
|
||||
@ -1396,7 +1397,7 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &ast::Pat,
|
||||
"__llmatch");
|
||||
trmode = TrByCopy(alloca_no_lifetime(bcx,
|
||||
llvariable_ty,
|
||||
&bcx.ident(ident)));
|
||||
&bcx.name(name)));
|
||||
}
|
||||
ast::BindByValue(_) => {
|
||||
// in this case, the final type of the variable will be T,
|
||||
@ -1404,13 +1405,13 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &ast::Pat,
|
||||
// above
|
||||
llmatch = alloca_no_lifetime(bcx,
|
||||
llvariable_ty.ptr_to(),
|
||||
&bcx.ident(ident));
|
||||
&bcx.name(name));
|
||||
trmode = TrByMove;
|
||||
}
|
||||
ast::BindByRef(_) => {
|
||||
llmatch = alloca_no_lifetime(bcx,
|
||||
llvariable_ty,
|
||||
&bcx.ident(ident));
|
||||
&bcx.name(name));
|
||||
trmode = TrByRef;
|
||||
}
|
||||
};
|
||||
@ -1527,7 +1528,7 @@ pub fn store_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
pat_bindings(&tcx.def_map, pat, |_, p_id, _, path1| {
|
||||
let scope = cleanup::var_scope(tcx, p_id);
|
||||
bcx = mk_binding_alloca(
|
||||
bcx, p_id, &path1.node, scope, (),
|
||||
bcx, p_id, path1.node.name, scope, (),
|
||||
|(), bcx, llval, ty| { drop_done_fill_mem(bcx, llval, ty); bcx });
|
||||
});
|
||||
bcx
|
||||
@ -1549,7 +1550,7 @@ pub fn store_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
Some(ident) => {
|
||||
let var_scope = cleanup::var_scope(tcx, local.id);
|
||||
return mk_binding_alloca(
|
||||
bcx, pat.id, ident, var_scope, (),
|
||||
bcx, pat.id, ident.name, var_scope, (),
|
||||
|(), bcx, v, _| expr::trans_into(bcx, &**init_expr,
|
||||
expr::SaveIn(v)));
|
||||
}
|
||||
@ -1605,7 +1606,7 @@ pub fn store_arg<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
||||
bcx
|
||||
} else {
|
||||
mk_binding_alloca(
|
||||
bcx, pat.id, ident, arg_scope, arg,
|
||||
bcx, pat.id, ident.name, arg_scope, arg,
|
||||
|arg, bcx, llval, _| arg.store_to(bcx, llval))
|
||||
}
|
||||
}
|
||||
@ -1622,7 +1623,7 @@ pub fn store_arg<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
||||
|
||||
fn mk_binding_alloca<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
|
||||
p_id: ast::NodeId,
|
||||
ident: &ast::Ident,
|
||||
name: ast::Name,
|
||||
cleanup_scope: cleanup::ScopeId,
|
||||
arg: A,
|
||||
populate: F)
|
||||
@ -1632,7 +1633,7 @@ fn mk_binding_alloca<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
|
||||
let var_ty = node_id_type(bcx, p_id);
|
||||
|
||||
// Allocate memory on stack for the binding.
|
||||
let llval = alloc_ty(bcx, var_ty, &bcx.ident(*ident));
|
||||
let llval = alloc_ty(bcx, var_ty, &bcx.name(name));
|
||||
|
||||
// Subtle: be sure that we *populate* the memory *before*
|
||||
// we schedule the cleanup.
|
||||
@ -1686,7 +1687,7 @@ fn bind_irrefutable_pat<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
// binding will live and place it into the appropriate
|
||||
// map.
|
||||
bcx = mk_binding_alloca(
|
||||
bcx, pat.id, &path1.node, cleanup_scope, (),
|
||||
bcx, pat.id, path1.node.name, cleanup_scope, (),
|
||||
|(), bcx, llval, ty| {
|
||||
match pat_binding_mode {
|
||||
ast::BindByValue(_) => {
|
||||
|
@ -48,7 +48,6 @@ use std::ffi::CString;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::result::Result as StdResult;
|
||||
use std::vec::Vec;
|
||||
use syntax::ast::Ident;
|
||||
use syntax::ast;
|
||||
use syntax::ast_map::{PathElem, PathName};
|
||||
use syntax::codemap::{DUMMY_SP, Span};
|
||||
@ -622,8 +621,8 @@ impl<'blk, 'tcx> BlockS<'blk, 'tcx> {
|
||||
}
|
||||
pub fn sess(&self) -> &'blk Session { self.fcx.ccx.sess() }
|
||||
|
||||
pub fn ident(&self, ident: Ident) -> String {
|
||||
token::get_ident(ident).to_string()
|
||||
pub fn name(&self, name: ast::Name) -> String {
|
||||
token::get_name(name).to_string()
|
||||
}
|
||||
|
||||
pub fn node_id_to_string(&self, id: ast::NodeId) -> String {
|
||||
|
@ -27,7 +27,6 @@ use middle::ty;
|
||||
use util::ppaux::Repr;
|
||||
|
||||
use syntax::ast;
|
||||
use syntax::ast::Ident;
|
||||
use syntax::ast_util;
|
||||
use syntax::parse::token::InternedString;
|
||||
use syntax::parse::token;
|
||||
@ -321,7 +320,7 @@ pub fn trans_loop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
|
||||
pub fn trans_break_cont<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
expr: &ast::Expr,
|
||||
opt_label: Option<Ident>,
|
||||
opt_label: Option<ast::Ident>,
|
||||
exit: usize)
|
||||
-> Block<'blk, 'tcx> {
|
||||
let _icx = push_ctxt("trans_break_cont");
|
||||
@ -354,14 +353,14 @@ pub fn trans_break_cont<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
|
||||
pub fn trans_break<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
expr: &ast::Expr,
|
||||
label_opt: Option<Ident>)
|
||||
label_opt: Option<ast::Ident>)
|
||||
-> Block<'blk, 'tcx> {
|
||||
return trans_break_cont(bcx, expr, label_opt, cleanup::EXIT_BREAK);
|
||||
}
|
||||
|
||||
pub fn trans_cont<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
expr: &ast::Expr,
|
||||
label_opt: Option<Ident>)
|
||||
label_opt: Option<ast::Ident>)
|
||||
-> Block<'blk, 'tcx> {
|
||||
return trans_break_cont(bcx, expr, label_opt, cleanup::EXIT_LOOP);
|
||||
}
|
||||
|
@ -773,11 +773,11 @@ pub fn create_global_var_metadata(cx: &CrateContext,
|
||||
|
||||
let var_item = cx.tcx().map.get(node_id);
|
||||
|
||||
let (ident, span) = match var_item {
|
||||
let (name, span) = match var_item {
|
||||
ast_map::NodeItem(item) => {
|
||||
match item.node {
|
||||
ast::ItemStatic(..) => (item.ident, item.span),
|
||||
ast::ItemConst(..) => (item.ident, item.span),
|
||||
ast::ItemStatic(..) => (item.ident.name, item.span),
|
||||
ast::ItemConst(..) => (item.ident.name, item.span),
|
||||
_ => {
|
||||
cx.sess()
|
||||
.span_bug(item.span,
|
||||
@ -806,7 +806,7 @@ pub fn create_global_var_metadata(cx: &CrateContext,
|
||||
let variable_type = ty::node_id_to_type(cx.tcx(), node_id);
|
||||
let type_metadata = type_metadata(cx, variable_type, span);
|
||||
let namespace_node = namespace_for_item(cx, ast_util::local_def(node_id));
|
||||
let var_name = token::get_ident(ident).to_string();
|
||||
let var_name = token::get_name(name).to_string();
|
||||
let linkage_name =
|
||||
namespace_node.mangled_name_of_contained_item(&var_name[..]);
|
||||
let var_scope = namespace_node.scope;
|
||||
@ -861,7 +861,7 @@ pub fn create_local_var_metadata(bcx: Block, local: &ast::Local) {
|
||||
let scope_metadata = scope_metadata(bcx.fcx, node_id, span);
|
||||
|
||||
declare_local(bcx,
|
||||
var_ident.node,
|
||||
var_ident.node.name,
|
||||
datum.ty,
|
||||
scope_metadata,
|
||||
DirectVariable { alloca: datum.val },
|
||||
@ -889,14 +889,14 @@ pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
|
||||
let ast_item = cx.tcx().map.find(node_id);
|
||||
|
||||
let variable_ident = match ast_item {
|
||||
let variable_name = match ast_item {
|
||||
None => {
|
||||
cx.sess().span_bug(span, "debuginfo::create_captured_var_metadata: node not found");
|
||||
}
|
||||
Some(ast_map::NodeLocal(pat)) | Some(ast_map::NodeArg(pat)) => {
|
||||
match pat.node {
|
||||
ast::PatIdent(_, ref path1, _) => {
|
||||
path1.node
|
||||
path1.node.name
|
||||
}
|
||||
_ => {
|
||||
cx.sess()
|
||||
@ -950,7 +950,7 @@ pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
};
|
||||
|
||||
declare_local(bcx,
|
||||
variable_ident,
|
||||
variable_name,
|
||||
variable_type,
|
||||
scope_metadata,
|
||||
variable_access,
|
||||
@ -963,7 +963,7 @@ pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
///
|
||||
/// Adds the created metadata nodes directly to the crate's IR.
|
||||
pub fn create_match_binding_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
variable_ident: ast::Ident,
|
||||
variable_name: ast::Name,
|
||||
binding: BindingInfo<'tcx>) {
|
||||
if bcx.unreachable.get() ||
|
||||
fn_should_be_ignored(bcx.fcx) ||
|
||||
@ -993,7 +993,7 @@ pub fn create_match_binding_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
};
|
||||
|
||||
declare_local(bcx,
|
||||
variable_ident,
|
||||
variable_name,
|
||||
binding.ty,
|
||||
scope_metadata,
|
||||
var_access,
|
||||
@ -1048,7 +1048,7 @@ pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
|
||||
};
|
||||
|
||||
declare_local(bcx,
|
||||
var_ident.node,
|
||||
var_ident.node.name,
|
||||
datum.ty,
|
||||
scope_metadata,
|
||||
DirectVariable { alloca: datum.val },
|
||||
@ -1283,7 +1283,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
|
||||
let fnitem = cx.tcx().map.get(fn_ast_id);
|
||||
|
||||
let (ident, fn_decl, generics, top_level_block, span, has_path) = match fnitem {
|
||||
let (name, fn_decl, generics, top_level_block, span, has_path) = match fnitem {
|
||||
ast_map::NodeItem(ref item) => {
|
||||
if contains_nodebug_attribute(&item.attrs) {
|
||||
return FunctionDebugContext::FunctionWithoutDebugInfo;
|
||||
@ -1291,7 +1291,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
|
||||
match item.node {
|
||||
ast::ItemFn(ref fn_decl, _, _, ref generics, ref top_level_block) => {
|
||||
(item.ident, fn_decl, generics, top_level_block, item.span, true)
|
||||
(item.ident.name, fn_decl, generics, top_level_block, item.span, true)
|
||||
}
|
||||
_ => {
|
||||
cx.sess().span_bug(item.span,
|
||||
@ -1306,7 +1306,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
return FunctionDebugContext::FunctionWithoutDebugInfo;
|
||||
}
|
||||
|
||||
(impl_item.ident,
|
||||
(impl_item.ident.name,
|
||||
&sig.decl,
|
||||
&sig.generics,
|
||||
body,
|
||||
@ -1329,7 +1329,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
match expr.node {
|
||||
ast::ExprClosure(_, ref fn_decl, ref top_level_block) => {
|
||||
let name = format!("fn{}", token::gensym("fn"));
|
||||
let name = token::str_to_ident(&name[..]);
|
||||
let name = token::intern(&name[..]);
|
||||
(name, fn_decl,
|
||||
// This is not quite right. It should actually inherit
|
||||
// the generics of the enclosing function.
|
||||
@ -1350,7 +1350,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
return FunctionDebugContext::FunctionWithoutDebugInfo;
|
||||
}
|
||||
|
||||
(trait_item.ident,
|
||||
(trait_item.ident.name,
|
||||
&sig.decl,
|
||||
&sig.generics,
|
||||
body,
|
||||
@ -1394,7 +1394,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
|
||||
// Get_template_parameters() will append a `<...>` clause to the function
|
||||
// name if necessary.
|
||||
let mut function_name = String::from_str(&token::get_ident(ident));
|
||||
let mut function_name = String::from_str(&token::get_name(name));
|
||||
let template_parameters = get_template_parameters(cx,
|
||||
generics,
|
||||
param_substs,
|
||||
@ -1541,10 +1541,9 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
actual_self_type,
|
||||
codemap::DUMMY_SP);
|
||||
|
||||
let ident = special_idents::type_self;
|
||||
let name = token::get_name(special_idents::type_self.name);
|
||||
|
||||
let ident = token::get_ident(ident);
|
||||
let name = CString::new(ident.as_bytes()).unwrap();
|
||||
let name = CString::new(name.as_bytes()).unwrap();
|
||||
let param_metadata = unsafe {
|
||||
llvm::LLVMDIBuilderCreateTemplateTypeParameter(
|
||||
DIB(cx),
|
||||
@ -1673,7 +1672,7 @@ fn compile_unit_metadata(cx: &CrateContext) -> DIDescriptor {
|
||||
}
|
||||
|
||||
fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
variable_ident: ast::Ident,
|
||||
variable_name: ast::Name,
|
||||
variable_type: Ty<'tcx>,
|
||||
scope_metadata: DIScope,
|
||||
variable_access: VariableAccess,
|
||||
@ -1684,7 +1683,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
let filename = span_start(cx, span).file.name.clone();
|
||||
let file_metadata = file_metadata(cx, &filename[..]);
|
||||
|
||||
let name = token::get_ident(variable_ident);
|
||||
let name = token::get_name(variable_name);
|
||||
let loc = span_start(cx, span);
|
||||
let type_metadata = type_metadata(cx, variable_type, span);
|
||||
|
||||
@ -2261,7 +2260,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> {
|
||||
// MemberDescription of the struct's single field.
|
||||
let sole_struct_member_description = MemberDescription {
|
||||
name: match non_null_variant.arg_names {
|
||||
Some(ref names) => token::get_ident(names[0]).to_string(),
|
||||
Some(ref names) => token::get_name(names[0]).to_string(),
|
||||
None => "".to_string()
|
||||
},
|
||||
llvm_type: non_null_llvm_type,
|
||||
@ -2429,9 +2428,8 @@ fn describe_enum_variant<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
let mut arg_names: Vec<_> = match variant_info.arg_names {
|
||||
Some(ref names) => {
|
||||
names.iter()
|
||||
.map(|ident| {
|
||||
token::get_ident(*ident).to_string()
|
||||
}).collect()
|
||||
.map(|&name| token::get_name(name).to_string())
|
||||
.collect()
|
||||
}
|
||||
None => variant_info.args.iter().map(|_| "".to_string()).collect()
|
||||
};
|
||||
@ -3245,11 +3243,10 @@ fn create_scope_map(cx: &CrateContext,
|
||||
|
||||
struct ScopeStackEntry {
|
||||
scope_metadata: DIScope,
|
||||
ident: Option<ast::Ident>
|
||||
name: Option<ast::Name>
|
||||
}
|
||||
|
||||
let mut scope_stack = vec!(ScopeStackEntry { scope_metadata: fn_metadata,
|
||||
ident: None });
|
||||
let mut scope_stack = vec!(ScopeStackEntry { scope_metadata: fn_metadata, name: None });
|
||||
scope_map.insert(fn_ast_id, fn_metadata);
|
||||
|
||||
// Push argument identifiers onto the stack so arguments integrate nicely
|
||||
@ -3257,7 +3254,7 @@ fn create_scope_map(cx: &CrateContext,
|
||||
for arg in args {
|
||||
pat_util::pat_bindings(def_map, &*arg.pat, |_, node_id, _, path1| {
|
||||
scope_stack.push(ScopeStackEntry { scope_metadata: fn_metadata,
|
||||
ident: Some(path1.node) });
|
||||
name: Some(path1.node.name) });
|
||||
scope_map.insert(node_id, fn_metadata);
|
||||
})
|
||||
}
|
||||
@ -3296,13 +3293,12 @@ fn create_scope_map(cx: &CrateContext,
|
||||
loc.col.to_usize() as c_uint)
|
||||
};
|
||||
|
||||
scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata,
|
||||
ident: None });
|
||||
scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata, name: None });
|
||||
|
||||
inner_walk(cx, scope_stack, scope_map);
|
||||
|
||||
// pop artificial scopes
|
||||
while scope_stack.last().unwrap().ident.is_some() {
|
||||
while scope_stack.last().unwrap().name.is_some() {
|
||||
scope_stack.pop();
|
||||
}
|
||||
|
||||
@ -3374,7 +3370,7 @@ fn create_scope_map(cx: &CrateContext,
|
||||
// scope stack and maybe introduce an artificial scope
|
||||
if pat_util::pat_is_binding(def_map, &*pat) {
|
||||
|
||||
let ident = path1.node;
|
||||
let name = path1.node.name;
|
||||
|
||||
// LLVM does not properly generate 'DW_AT_start_scope' fields
|
||||
// for variable DIEs. For this reason we have to introduce
|
||||
@ -3401,7 +3397,7 @@ fn create_scope_map(cx: &CrateContext,
|
||||
// variables with the same name will cause the problem.
|
||||
let need_new_scope = scope_stack
|
||||
.iter()
|
||||
.any(|entry| entry.ident.iter().any(|i| i.name == ident.name));
|
||||
.any(|entry| entry.name == Some(name));
|
||||
|
||||
if need_new_scope {
|
||||
// Create a new lexical scope and push it onto the stack
|
||||
@ -3420,7 +3416,7 @@ fn create_scope_map(cx: &CrateContext,
|
||||
|
||||
scope_stack.push(ScopeStackEntry {
|
||||
scope_metadata: scope_metadata,
|
||||
ident: Some(ident)
|
||||
name: Some(name)
|
||||
});
|
||||
|
||||
} else {
|
||||
@ -3428,7 +3424,7 @@ fn create_scope_map(cx: &CrateContext,
|
||||
let prev_metadata = scope_stack.last().unwrap().scope_metadata;
|
||||
scope_stack.push(ScopeStackEntry {
|
||||
scope_metadata: prev_metadata,
|
||||
ident: Some(ident)
|
||||
name: Some(name)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -3970,8 +3966,8 @@ fn namespace_for_item(cx: &CrateContext, def_id: ast::DefId) -> Rc<NamespaceTree
|
||||
ty::with_path(cx.tcx(), def_id, |path| {
|
||||
// prepend crate name if not already present
|
||||
let krate = if def_id.krate == ast::LOCAL_CRATE {
|
||||
let crate_namespace_ident = token::str_to_ident(crate_root_namespace(cx));
|
||||
Some(ast_map::PathMod(crate_namespace_ident.name))
|
||||
let crate_namespace_name = token::intern(crate_root_namespace(cx));
|
||||
Some(ast_map::PathMod(crate_namespace_name))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
@ -678,7 +678,7 @@ fn trans_datum_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
trans_def(bcx, expr, bcx.def(expr.id))
|
||||
}
|
||||
ast::ExprField(ref base, ident) => {
|
||||
trans_rec_field(bcx, &**base, ident.node)
|
||||
trans_rec_field(bcx, &**base, ident.node.name)
|
||||
}
|
||||
ast::ExprTupField(ref base, idx) => {
|
||||
trans_rec_tup_field(bcx, &**base, idx.node)
|
||||
@ -777,9 +777,9 @@ fn trans_field<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
|
||||
/// Translates `base.field`.
|
||||
fn trans_rec_field<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
base: &ast::Expr,
|
||||
field: ast::Ident)
|
||||
field: ast::Name)
|
||||
-> DatumBlock<'blk, 'tcx, Expr> {
|
||||
trans_field(bcx, base, |tcx, field_tys| ty::field_idx_strict(tcx, field.name, field_tys))
|
||||
trans_field(bcx, base, |tcx, field_tys| ty::field_idx_strict(tcx, field, field_tys))
|
||||
}
|
||||
|
||||
/// Translates `base.<idx>`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user