commit
edf351e9f7
14 changed files with 48 additions and 49 deletions
|
@ -271,7 +271,7 @@ fn item_region_param_defs(item_doc: ebml::Doc, cdata: Cmd)
|
||||||
tag_region_param_def_def_id);
|
tag_region_param_def_def_id);
|
||||||
let def_id = reader::with_doc_data(def_id_doc, parse_def_id);
|
let def_id = reader::with_doc_data(def_id_doc, parse_def_id);
|
||||||
let def_id = translate_def_id(cdata, def_id);
|
let def_id = translate_def_id(cdata, def_id);
|
||||||
v.push(ty::RegionParameterDef { ident: ident,
|
v.push(ty::RegionParameterDef { ident: ident.name,
|
||||||
def_id: def_id });
|
def_id: def_id });
|
||||||
true
|
true
|
||||||
});
|
});
|
||||||
|
|
|
@ -112,8 +112,8 @@ pub fn reachable(ecx: &EncodeContext, id: NodeId) -> bool {
|
||||||
reachable.get().contains(&id)
|
reachable.get().contains(&id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_name(ebml_w: &mut writer::Encoder, name: Ident) {
|
fn encode_name(ebml_w: &mut writer::Encoder, name: Name) {
|
||||||
ebml_w.wr_tagged_str(tag_paths_data_name, token::get_ident(name).get());
|
ebml_w.wr_tagged_str(tag_paths_data_name, token::get_name(name).get());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_impl_type_basename(ebml_w: &mut writer::Encoder, name: Ident) {
|
fn encode_impl_type_basename(ebml_w: &mut writer::Encoder, name: Ident) {
|
||||||
|
@ -313,7 +313,7 @@ fn encode_struct_fields(ebml_w: &mut writer::Encoder,
|
||||||
NamedField(ident, vis) => {
|
NamedField(ident, vis) => {
|
||||||
ebml_w.start_tag(tag_item_field);
|
ebml_w.start_tag(tag_item_field);
|
||||||
encode_struct_field_family(ebml_w, vis);
|
encode_struct_field_family(ebml_w, vis);
|
||||||
encode_name(ebml_w, ident);
|
encode_name(ebml_w, ident.name);
|
||||||
encode_def_id(ebml_w, local_def(f.node.id));
|
encode_def_id(ebml_w, local_def(f.node.id));
|
||||||
ebml_w.end_tag();
|
ebml_w.end_tag();
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ fn encode_enum_variant_info(ecx: &EncodeContext,
|
||||||
ast::TupleVariantKind(_) => encode_family(ebml_w, 'v'),
|
ast::TupleVariantKind(_) => encode_family(ebml_w, 'v'),
|
||||||
ast::StructVariantKind(_) => encode_family(ebml_w, 'V')
|
ast::StructVariantKind(_) => encode_family(ebml_w, 'V')
|
||||||
}
|
}
|
||||||
encode_name(ebml_w, variant.node.name);
|
encode_name(ebml_w, variant.node.name.name);
|
||||||
encode_parent_item(ebml_w, local_def(id));
|
encode_parent_item(ebml_w, local_def(id));
|
||||||
encode_visibility(ebml_w, variant.node.vis);
|
encode_visibility(ebml_w, variant.node.vis);
|
||||||
encode_attributes(ebml_w, variant.node.attrs);
|
encode_attributes(ebml_w, variant.node.attrs);
|
||||||
|
@ -580,7 +580,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
|
||||||
ebml_w.start_tag(tag_items_data_item);
|
ebml_w.start_tag(tag_items_data_item);
|
||||||
encode_def_id(ebml_w, local_def(id));
|
encode_def_id(ebml_w, local_def(id));
|
||||||
encode_family(ebml_w, 'm');
|
encode_family(ebml_w, 'm');
|
||||||
encode_name(ebml_w, name);
|
encode_name(ebml_w, name.name);
|
||||||
debug!("(encoding info for module) encoding info for module ID {}", id);
|
debug!("(encoding info for module) encoding info for module ID {}", id);
|
||||||
|
|
||||||
// Encode info about all the module children.
|
// Encode info about all the module children.
|
||||||
|
@ -717,7 +717,7 @@ fn encode_info_for_struct(ecx: &EncodeContext,
|
||||||
debug!("encode_info_for_struct: doing {} {}",
|
debug!("encode_info_for_struct: doing {} {}",
|
||||||
token::get_ident(nm), id);
|
token::get_ident(nm), id);
|
||||||
encode_struct_field_family(ebml_w, vis);
|
encode_struct_field_family(ebml_w, vis);
|
||||||
encode_name(ebml_w, nm);
|
encode_name(ebml_w, nm.name);
|
||||||
encode_type(ecx, ebml_w, node_id_to_type(tcx, id));
|
encode_type(ecx, ebml_w, node_id_to_type(tcx, id));
|
||||||
encode_def_id(ebml_w, local_def(id));
|
encode_def_id(ebml_w, local_def(id));
|
||||||
ebml_w.end_tag();
|
ebml_w.end_tag();
|
||||||
|
@ -744,7 +744,7 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
|
||||||
encode_family(ebml_w, 'f');
|
encode_family(ebml_w, 'f');
|
||||||
encode_bounds_and_type(ebml_w, ecx,
|
encode_bounds_and_type(ebml_w, ecx,
|
||||||
&lookup_item_type(ecx.tcx, local_def(ctor_id)));
|
&lookup_item_type(ecx.tcx, local_def(ctor_id)));
|
||||||
encode_name(ebml_w, name);
|
encode_name(ebml_w, name.name);
|
||||||
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, ctor_id));
|
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, ctor_id));
|
||||||
ecx.tcx.map.with_path(ctor_id, |path| encode_path(ebml_w, path));
|
ecx.tcx.map.with_path(ctor_id, |path| encode_path(ebml_w, path));
|
||||||
encode_parent_item(ebml_w, local_def(struct_id));
|
encode_parent_item(ebml_w, local_def(struct_id));
|
||||||
|
@ -767,7 +767,7 @@ fn encode_method_ty_fields(ecx: &EncodeContext,
|
||||||
ebml_w: &mut writer::Encoder,
|
ebml_w: &mut writer::Encoder,
|
||||||
method_ty: &ty::Method) {
|
method_ty: &ty::Method) {
|
||||||
encode_def_id(ebml_w, method_ty.def_id);
|
encode_def_id(ebml_w, method_ty.def_id);
|
||||||
encode_name(ebml_w, method_ty.ident);
|
encode_name(ebml_w, method_ty.ident.name);
|
||||||
encode_ty_type_param_defs(ebml_w, ecx,
|
encode_ty_type_param_defs(ebml_w, ecx,
|
||||||
method_ty.generics.type_param_defs(),
|
method_ty.generics.type_param_defs(),
|
||||||
tag_item_method_tps);
|
tag_item_method_tps);
|
||||||
|
@ -917,7 +917,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
}
|
}
|
||||||
encode_type(ecx, ebml_w, node_id_to_type(tcx, item.id));
|
encode_type(ecx, ebml_w, node_id_to_type(tcx, item.id));
|
||||||
encode_symbol(ecx, ebml_w, item.id);
|
encode_symbol(ecx, ebml_w, item.id);
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_path(ebml_w, path);
|
encode_path(ebml_w, path);
|
||||||
|
|
||||||
let inlineable = !ecx.non_inlineable_statics.borrow().get().contains(&item.id);
|
let inlineable = !ecx.non_inlineable_statics.borrow().get().contains(&item.id);
|
||||||
|
@ -935,7 +935,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
encode_family(ebml_w, purity_fn_family(purity));
|
encode_family(ebml_w, purity_fn_family(purity));
|
||||||
let tps_len = generics.ty_params.len();
|
let tps_len = generics.ty_params.len();
|
||||||
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_path(ebml_w, path);
|
encode_path(ebml_w, path);
|
||||||
encode_attributes(ebml_w, item.attrs);
|
encode_attributes(ebml_w, item.attrs);
|
||||||
if tps_len > 0u || should_inline(item.attrs) {
|
if tps_len > 0u || should_inline(item.attrs) {
|
||||||
|
@ -961,7 +961,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
ebml_w.start_tag(tag_items_data_item);
|
ebml_w.start_tag(tag_items_data_item);
|
||||||
encode_def_id(ebml_w, def_id);
|
encode_def_id(ebml_w, def_id);
|
||||||
encode_family(ebml_w, 'n');
|
encode_family(ebml_w, 'n');
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_path(ebml_w, path);
|
encode_path(ebml_w, path);
|
||||||
|
|
||||||
// Encode all the items in this module.
|
// Encode all the items in this module.
|
||||||
|
@ -979,7 +979,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
encode_def_id(ebml_w, def_id);
|
encode_def_id(ebml_w, def_id);
|
||||||
encode_family(ebml_w, 'y');
|
encode_family(ebml_w, 'y');
|
||||||
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_path(ebml_w, path);
|
encode_path(ebml_w, path);
|
||||||
encode_visibility(ebml_w, vis);
|
encode_visibility(ebml_w, vis);
|
||||||
ebml_w.end_tag();
|
ebml_w.end_tag();
|
||||||
|
@ -992,7 +992,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
encode_family(ebml_w, 't');
|
encode_family(ebml_w, 't');
|
||||||
encode_item_variances(ebml_w, ecx, item.id);
|
encode_item_variances(ebml_w, ecx, item.id);
|
||||||
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_attributes(ebml_w, item.attrs);
|
encode_attributes(ebml_w, item.attrs);
|
||||||
for v in (*enum_definition).variants.iter() {
|
for v in (*enum_definition).variants.iter() {
|
||||||
encode_variant_id(ebml_w, local_def(v.node.id));
|
encode_variant_id(ebml_w, local_def(v.node.id));
|
||||||
|
@ -1031,7 +1031,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
||||||
|
|
||||||
encode_item_variances(ebml_w, ecx, item.id);
|
encode_item_variances(ebml_w, ecx, item.id);
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_attributes(ebml_w, item.attrs);
|
encode_attributes(ebml_w, item.attrs);
|
||||||
encode_path(ebml_w, path.clone());
|
encode_path(ebml_w, path.clone());
|
||||||
encode_visibility(ebml_w, vis);
|
encode_visibility(ebml_w, vis);
|
||||||
|
@ -1071,7 +1071,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
encode_def_id(ebml_w, def_id);
|
encode_def_id(ebml_w, def_id);
|
||||||
encode_family(ebml_w, 'i');
|
encode_family(ebml_w, 'i');
|
||||||
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_attributes(ebml_w, item.attrs);
|
encode_attributes(ebml_w, item.attrs);
|
||||||
match ty.node {
|
match ty.node {
|
||||||
ast::TyPath(ref path, ref bounds, _) if path.segments
|
ast::TyPath(ref path, ref bounds, _) if path.segments
|
||||||
|
@ -1135,7 +1135,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
||||||
tag_items_data_item_ty_param_bounds);
|
tag_items_data_item_ty_param_bounds);
|
||||||
encode_region_param_defs(ebml_w, trait_def.generics.region_param_defs());
|
encode_region_param_defs(ebml_w, trait_def.generics.region_param_defs());
|
||||||
encode_trait_ref(ebml_w, ecx, trait_def.trait_ref, tag_item_trait_ref);
|
encode_trait_ref(ebml_w, ecx, trait_def.trait_ref, tag_item_trait_ref);
|
||||||
encode_name(ebml_w, item.ident);
|
encode_name(ebml_w, item.ident.name);
|
||||||
encode_attributes(ebml_w, item.attrs);
|
encode_attributes(ebml_w, item.attrs);
|
||||||
encode_visibility(ebml_w, vis);
|
encode_visibility(ebml_w, vis);
|
||||||
for &method_def_id in ty::trait_method_def_ids(tcx, def_id).iter() {
|
for &method_def_id in ty::trait_method_def_ids(tcx, def_id).iter() {
|
||||||
|
@ -1256,7 +1256,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
|
||||||
encode_family(ebml_w, purity_fn_family(ImpureFn));
|
encode_family(ebml_w, purity_fn_family(ImpureFn));
|
||||||
encode_bounds_and_type(ebml_w, ecx,
|
encode_bounds_and_type(ebml_w, ecx,
|
||||||
&lookup_item_type(ecx.tcx,local_def(nitem.id)));
|
&lookup_item_type(ecx.tcx,local_def(nitem.id)));
|
||||||
encode_name(ebml_w, nitem.ident);
|
encode_name(ebml_w, nitem.ident.name);
|
||||||
if abi.is_intrinsic() {
|
if abi.is_intrinsic() {
|
||||||
(ecx.encode_inlined_item)(ecx, ebml_w, IIForeignRef(nitem));
|
(ecx.encode_inlined_item)(ecx, ebml_w, IIForeignRef(nitem));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1271,7 +1271,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
|
||||||
}
|
}
|
||||||
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, nitem.id));
|
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, nitem.id));
|
||||||
encode_symbol(ecx, ebml_w, nitem.id);
|
encode_symbol(ecx, ebml_w, nitem.id);
|
||||||
encode_name(ebml_w, nitem.ident);
|
encode_name(ebml_w, nitem.ident.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
encode_path(ebml_w, path);
|
encode_path(ebml_w, path);
|
||||||
|
|
|
@ -214,7 +214,7 @@ fn parse_bound_region(st: &mut PState, conv: conv_did) -> ty::BoundRegion {
|
||||||
'[' => {
|
'[' => {
|
||||||
let def = parse_def(st, RegionParameter, |x,y| conv(x,y));
|
let def = parse_def(st, RegionParameter, |x,y| conv(x,y));
|
||||||
let ident = token::str_to_ident(parse_str(st, ']'));
|
let ident = token::str_to_ident(parse_str(st, ']'));
|
||||||
ty::BrNamed(def, ident)
|
ty::BrNamed(def, ident.name)
|
||||||
}
|
}
|
||||||
'f' => {
|
'f' => {
|
||||||
let id = parse_uint(st);
|
let id = parse_uint(st);
|
||||||
|
@ -242,7 +242,7 @@ fn parse_region(st: &mut PState, conv: conv_did) -> ty::Region {
|
||||||
let index = parse_uint(st);
|
let index = parse_uint(st);
|
||||||
assert_eq!(next(st), '|');
|
assert_eq!(next(st), '|');
|
||||||
let nm = token::str_to_ident(parse_str(st, ']'));
|
let nm = token::str_to_ident(parse_str(st, ']'));
|
||||||
ty::ReEarlyBound(node_id, index, nm)
|
ty::ReEarlyBound(node_id, index, nm.name)
|
||||||
}
|
}
|
||||||
'f' => {
|
'f' => {
|
||||||
assert_eq!(next(st), '[');
|
assert_eq!(next(st), '[');
|
||||||
|
|
|
@ -179,7 +179,7 @@ fn enc_region(w: &mut MemWriter, cx: @ctxt, r: ty::Region) {
|
||||||
mywrite!(w, "B[{}|{}|{}]",
|
mywrite!(w, "B[{}|{}|{}]",
|
||||||
node_id,
|
node_id,
|
||||||
index,
|
index,
|
||||||
token::get_ident(ident));
|
token::get_name(ident));
|
||||||
}
|
}
|
||||||
ty::ReFree(ref fr) => {
|
ty::ReFree(ref fr) => {
|
||||||
mywrite!(w, "f[{}|", fr.scope_id);
|
mywrite!(w, "f[{}|", fr.scope_id);
|
||||||
|
@ -210,7 +210,7 @@ fn enc_bound_region(w: &mut MemWriter, cx: @ctxt, br: ty::BoundRegion) {
|
||||||
ty::BrNamed(d, s) => {
|
ty::BrNamed(d, s) => {
|
||||||
mywrite!(w, "[{}|{}]",
|
mywrite!(w, "[{}|{}]",
|
||||||
(cx.ds)(d),
|
(cx.ds)(d),
|
||||||
token::get_ident(s));
|
token::get_name(s));
|
||||||
}
|
}
|
||||||
ty::BrFresh(id) => {
|
ty::BrFresh(id) => {
|
||||||
mywrite!(w, "f{}|", id);
|
mywrite!(w, "f{}|", id);
|
||||||
|
|
|
@ -145,7 +145,7 @@ impl<'a> Visitor<&'a ScopeChain<'a>> for LifetimeContext {
|
||||||
fn visit_lifetime_ref(&mut self,
|
fn visit_lifetime_ref(&mut self,
|
||||||
lifetime_ref: &ast::Lifetime,
|
lifetime_ref: &ast::Lifetime,
|
||||||
scope: &'a ScopeChain<'a>) {
|
scope: &'a ScopeChain<'a>) {
|
||||||
if lifetime_ref.ident == special_idents::statik {
|
if lifetime_ref.ident == special_idents::statik.name {
|
||||||
self.insert_lifetime(lifetime_ref, ast::DefStaticRegion);
|
self.insert_lifetime(lifetime_ref, ast::DefStaticRegion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ impl LifetimeContext {
|
||||||
self.sess.span_err(
|
self.sess.span_err(
|
||||||
lifetime_ref.span,
|
lifetime_ref.span,
|
||||||
format!("use of undeclared lifetime name `'{}`",
|
format!("use of undeclared lifetime name `'{}`",
|
||||||
token::get_ident(lifetime_ref.ident)));
|
token::get_name(lifetime_ref.ident)));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_lifetime_names(&self, lifetimes: &OptVec<ast::Lifetime>) {
|
fn check_lifetime_names(&self, lifetimes: &OptVec<ast::Lifetime>) {
|
||||||
|
@ -271,11 +271,11 @@ impl LifetimeContext {
|
||||||
|
|
||||||
let special_idents = [special_idents::statik];
|
let special_idents = [special_idents::statik];
|
||||||
for lifetime in lifetimes.iter() {
|
for lifetime in lifetimes.iter() {
|
||||||
if special_idents.iter().any(|&i| i == lifetime.ident) {
|
if special_idents.iter().any(|&i| i.name == lifetime.ident) {
|
||||||
self.sess.span_err(
|
self.sess.span_err(
|
||||||
lifetime.span,
|
lifetime.span,
|
||||||
format!("illegal lifetime parameter name: `{}`",
|
format!("illegal lifetime parameter name: `{}`",
|
||||||
token::get_ident(lifetime.ident)));
|
token::get_name(lifetime.ident)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ impl LifetimeContext {
|
||||||
lifetime_j.span,
|
lifetime_j.span,
|
||||||
format!("lifetime name `'{}` declared twice in \
|
format!("lifetime name `'{}` declared twice in \
|
||||||
the same scope",
|
the same scope",
|
||||||
token::get_ident(lifetime_j.ident)));
|
token::get_name(lifetime_j.ident)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -465,7 +465,7 @@ pub enum Region {
|
||||||
// Region bound in a type or fn declaration which will be
|
// Region bound in a type or fn declaration which will be
|
||||||
// substituted 'early' -- that is, at the same time when type
|
// substituted 'early' -- that is, at the same time when type
|
||||||
// parameters are substituted.
|
// parameters are substituted.
|
||||||
ReEarlyBound(/* param id */ ast::NodeId, /*index*/ uint, ast::Ident),
|
ReEarlyBound(/* param id */ ast::NodeId, /*index*/ uint, ast::Name),
|
||||||
|
|
||||||
// Region bound in a function scope, which will be substituted when the
|
// Region bound in a function scope, which will be substituted when the
|
||||||
// function is called. The first argument must be the `binder_id` of
|
// function is called. The first argument must be the `binder_id` of
|
||||||
|
@ -635,7 +635,7 @@ pub enum BoundRegion {
|
||||||
///
|
///
|
||||||
/// The def-id is needed to distinguish free regions in
|
/// The def-id is needed to distinguish free regions in
|
||||||
/// the event of shadowing.
|
/// the event of shadowing.
|
||||||
BrNamed(ast::DefId, ast::Ident),
|
BrNamed(ast::DefId, ast::Name),
|
||||||
|
|
||||||
/// Fresh bound identifiers created during GLB computations.
|
/// Fresh bound identifiers created during GLB computations.
|
||||||
BrFresh(uint),
|
BrFresh(uint),
|
||||||
|
@ -976,7 +976,7 @@ pub struct TypeParameterDef {
|
||||||
|
|
||||||
#[deriving(Encodable, Decodable, Clone)]
|
#[deriving(Encodable, Decodable, Clone)]
|
||||||
pub struct RegionParameterDef {
|
pub struct RegionParameterDef {
|
||||||
ident: ast::Ident,
|
ident: ast::Name,
|
||||||
def_id: ast::DefId,
|
def_id: ast::DefId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ pub fn bound_region_to_str(cx: ctxt,
|
||||||
|
|
||||||
match br {
|
match br {
|
||||||
BrNamed(_, ident) => format!("{}'{}{}", prefix,
|
BrNamed(_, ident) => format!("{}'{}{}", prefix,
|
||||||
token::get_ident(ident), space_str),
|
token::get_name(ident), space_str),
|
||||||
BrAnon(_) => prefix.to_str(),
|
BrAnon(_) => prefix.to_str(),
|
||||||
BrFresh(_) => prefix.to_str(),
|
BrFresh(_) => prefix.to_str(),
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ pub fn region_to_str(cx: ctxt, prefix: &str, space: bool, region: Region) -> ~st
|
||||||
// `explain_region()` or `note_and_explain_region()`.
|
// `explain_region()` or `note_and_explain_region()`.
|
||||||
match region {
|
match region {
|
||||||
ty::ReScope(_) => prefix.to_str(),
|
ty::ReScope(_) => prefix.to_str(),
|
||||||
ty::ReEarlyBound(_, _, ident) => token::get_ident(ident).get().to_str(),
|
ty::ReEarlyBound(_, _, ident) => token::get_name(ident).get().to_str(),
|
||||||
ty::ReLateBound(_, br) => bound_region_to_str(cx, prefix, space, br),
|
ty::ReLateBound(_, br) => bound_region_to_str(cx, prefix, space, br),
|
||||||
ty::ReFree(ref fr) => bound_region_to_str(cx, prefix, space, fr.bound_region),
|
ty::ReFree(ref fr) => bound_region_to_str(cx, prefix, space, fr.bound_region),
|
||||||
ty::ReInfer(ReSkolemized(_, br)) => {
|
ty::ReInfer(ReSkolemized(_, br)) => {
|
||||||
|
@ -630,7 +630,7 @@ impl Repr for ty::TypeParameterDef {
|
||||||
impl Repr for ty::RegionParameterDef {
|
impl Repr for ty::RegionParameterDef {
|
||||||
fn repr(&self, _tcx: ctxt) -> ~str {
|
fn repr(&self, _tcx: ctxt) -> ~str {
|
||||||
format!("RegionParameterDef({}, {:?})",
|
format!("RegionParameterDef({}, {:?})",
|
||||||
token::get_ident(self.ident),
|
token::get_name(self.ident),
|
||||||
self.def_id)
|
self.def_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,7 +718,7 @@ impl Repr for ty::BoundRegion {
|
||||||
ty::BrAnon(id) => format!("BrAnon({})", id),
|
ty::BrAnon(id) => format!("BrAnon({})", id),
|
||||||
ty::BrNamed(id, ident) => format!("BrNamed({}, {})",
|
ty::BrNamed(id, ident) => format!("BrNamed({}, {})",
|
||||||
id.repr(tcx),
|
id.repr(tcx),
|
||||||
ident.repr(tcx)),
|
token::get_name(ident)),
|
||||||
ty::BrFresh(id) => format!("BrFresh({})", id),
|
ty::BrFresh(id) => format!("BrFresh({})", id),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -729,7 +729,7 @@ impl Repr for ty::Region {
|
||||||
match *self {
|
match *self {
|
||||||
ty::ReEarlyBound(id, index, ident) => {
|
ty::ReEarlyBound(id, index, ident) => {
|
||||||
format!("ReEarlyBound({}, {}, {})",
|
format!("ReEarlyBound({}, {}, {})",
|
||||||
id, index, ident.repr(tcx))
|
id, index, token::get_name(ident))
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::ReLateBound(binder_id, ref bound_region) => {
|
ty::ReLateBound(binder_id, ref bound_region) => {
|
||||||
|
|
|
@ -307,7 +307,7 @@ impl Lifetime {
|
||||||
|
|
||||||
impl Clean<Lifetime> for ast::Lifetime {
|
impl Clean<Lifetime> for ast::Lifetime {
|
||||||
fn clean(&self) -> Lifetime {
|
fn clean(&self) -> Lifetime {
|
||||||
Lifetime(self.ident.clean())
|
Lifetime(token::get_name(self.ident).get().to_owned())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,7 @@ pub type FnIdent = Option<Ident>;
|
||||||
pub struct Lifetime {
|
pub struct Lifetime {
|
||||||
id: NodeId,
|
id: NodeId,
|
||||||
span: Span,
|
span: Span,
|
||||||
// FIXME #7743 : change this to Name!
|
ident: Name
|
||||||
ident: Ident
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// a "Path" is essentially Rust's notion of a name;
|
// a "Path" is essentially Rust's notion of a name;
|
||||||
|
|
|
@ -73,7 +73,7 @@ pub trait AstBuilder {
|
||||||
|
|
||||||
fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
|
fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
|
||||||
fn typarambound(&self, path: ast::Path) -> ast::TyParamBound;
|
fn typarambound(&self, path: ast::Path) -> ast::TyParamBound;
|
||||||
fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime;
|
fn lifetime(&self, span: Span, ident: ast::Name) -> ast::Lifetime;
|
||||||
|
|
||||||
// statements
|
// statements
|
||||||
fn stmt_expr(&self, expr: @ast::Expr) -> @ast::Stmt;
|
fn stmt_expr(&self, expr: @ast::Expr) -> @ast::Stmt;
|
||||||
|
@ -411,7 +411,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||||
ast::TraitTyParamBound(self.trait_ref(path))
|
ast::TraitTyParamBound(self.trait_ref(path))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime {
|
fn lifetime(&self, span: Span, ident: ast::Name) -> ast::Lifetime {
|
||||||
ast::Lifetime { id: ast::DUMMY_NODE_ID, span: span, ident: ident }
|
ast::Lifetime { id: ast::DUMMY_NODE_ID, span: span, ident: ident }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,14 +111,14 @@ pub fn nil_ty() -> Ty<'static> {
|
||||||
|
|
||||||
fn mk_lifetime(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Option<ast::Lifetime> {
|
fn mk_lifetime(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Option<ast::Lifetime> {
|
||||||
match *lt {
|
match *lt {
|
||||||
Some(ref s) => Some(cx.lifetime(span, cx.ident_of(*s))),
|
Some(ref s) => Some(cx.lifetime(span, cx.ident_of(*s).name)),
|
||||||
None => None
|
None => None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mk_lifetimes(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> OptVec<ast::Lifetime> {
|
fn mk_lifetimes(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> OptVec<ast::Lifetime> {
|
||||||
match *lt {
|
match *lt {
|
||||||
Some(ref s) => opt_vec::with(cx.lifetime(span, cx.ident_of(*s))),
|
Some(ref s) => opt_vec::with(cx.lifetime(span, cx.ident_of(*s).name)),
|
||||||
None => opt_vec::Empty
|
None => opt_vec::Empty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ impl<'a> LifetimeBounds<'a> {
|
||||||
self_generics: &Generics)
|
self_generics: &Generics)
|
||||||
-> Generics {
|
-> Generics {
|
||||||
let lifetimes = self.lifetimes.map(|lt| {
|
let lifetimes = self.lifetimes.map(|lt| {
|
||||||
cx.lifetime(span, cx.ident_of(*lt))
|
cx.lifetime(span, cx.ident_of(*lt).name)
|
||||||
});
|
});
|
||||||
let ty_params = self.bounds.map(|t| {
|
let ty_params = self.bounds.map(|t| {
|
||||||
match t {
|
match t {
|
||||||
|
@ -248,7 +248,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
|
||||||
match *ptr {
|
match *ptr {
|
||||||
Send => ast::SelfUniq,
|
Send => ast::SelfUniq,
|
||||||
Borrowed(ref lt, mutbl) => {
|
Borrowed(ref lt, mutbl) => {
|
||||||
let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s)));
|
let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s).name));
|
||||||
ast::SelfRegion(lt, mutbl)
|
ast::SelfRegion(lt, mutbl)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -497,7 +497,7 @@ impl<'a> Context<'a> {
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let life = self.ecx.lifetime(sp, self.ecx.ident_of("static"));
|
let life = self.ecx.lifetime(sp, self.ecx.ident_of("static").name);
|
||||||
let ty = self.ecx.ty_path(self.ecx.path_all(
|
let ty = self.ecx.ty_path(self.ecx.path_all(
|
||||||
sp,
|
sp,
|
||||||
true,
|
true,
|
||||||
|
@ -629,7 +629,7 @@ impl<'a> Context<'a> {
|
||||||
self.ecx.ident_of("Piece"),
|
self.ecx.ident_of("Piece"),
|
||||||
],
|
],
|
||||||
opt_vec::with(
|
opt_vec::with(
|
||||||
self.ecx.lifetime(self.fmtsp, self.ecx.ident_of("static"))),
|
self.ecx.lifetime(self.fmtsp, self.ecx.ident_of("static").name)),
|
||||||
~[]
|
~[]
|
||||||
), None);
|
), None);
|
||||||
let ty = ast::TyFixedLengthVec(
|
let ty = ast::TyFixedLengthVec(
|
||||||
|
|
|
@ -1596,7 +1596,7 @@ impl Parser {
|
||||||
return ast::Lifetime {
|
return ast::Lifetime {
|
||||||
id: ast::DUMMY_NODE_ID,
|
id: ast::DUMMY_NODE_ID,
|
||||||
span: span,
|
span: span,
|
||||||
ident: i
|
ident: i.name
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|
|
@ -1951,7 +1951,7 @@ pub fn print_bounds(s: &mut State, bounds: &OptVec<ast::TyParamBound>,
|
||||||
pub fn print_lifetime(s: &mut State,
|
pub fn print_lifetime(s: &mut State,
|
||||||
lifetime: &ast::Lifetime) -> io::IoResult<()> {
|
lifetime: &ast::Lifetime) -> io::IoResult<()> {
|
||||||
try!(word(&mut s.s, "'"));
|
try!(word(&mut s.s, "'"));
|
||||||
print_ident(s, lifetime.ident)
|
print_name(s, lifetime.ident)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_generics(s: &mut State,
|
pub fn print_generics(s: &mut State,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue