diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-06-10 00:49:59 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-06-13 11:30:45 -0700 |
| commit | ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a (patch) | |
| tree | 55c2ee5be0986c2489879022d4788d6c3ac2c964 /src/rustdoc | |
| parent | bdd20000665a35e14b4ec2c54f893fc80fe451ef (diff) | |
| download | rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.tar.gz rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.zip | |
Box AST idents
Diffstat (limited to 'src/rustdoc')
| -rw-r--r-- | src/rustdoc/attr_parser.rs | 5 | ||||
| -rw-r--r-- | src/rustdoc/attr_pass.rs | 6 | ||||
| -rw-r--r-- | src/rustdoc/extract.rs | 10 | ||||
| -rw-r--r-- | src/rustdoc/prune_unexported_pass.rs | 4 | ||||
| -rw-r--r-- | src/rustdoc/reexport_pass.rs | 8 | ||||
| -rw-r--r-- | src/rustdoc/tystr_pass.rs | 10 |
6 files changed, 22 insertions, 21 deletions
diff --git a/src/rustdoc/attr_parser.rs b/src/rustdoc/attr_parser.rs index a16c90b4c08..ca0878626a4 100644 --- a/src/rustdoc/attr_parser.rs +++ b/src/rustdoc/attr_parser.rs @@ -67,7 +67,8 @@ fn parse_crate(attrs: [ast::attribute]) -> crate_attrs { let link_metas = attr::find_linkage_metas(attrs); { - name: attr::last_meta_item_value_str_by_name(link_metas, "name") + name: attr::last_meta_item_value_str_by_name( + link_metas, "name").map({|x|*x}) } } @@ -98,7 +99,7 @@ fn should_not_extract_crate_name_if_no_name_value_in_link_attribute() { fn parse_desc(attrs: [ast::attribute]) -> option<str> { alt doc_meta(attrs) { some(meta) { - attr::get_meta_item_value_str(meta) + attr::get_meta_item_value_str(meta).map({|x|*x}) } none { none } } diff --git a/src/rustdoc/attr_pass.rs b/src/rustdoc/attr_pass.rs index 9f1fc9fdc22..983576e5816 100644 --- a/src/rustdoc/attr_pass.rs +++ b/src/rustdoc/attr_pass.rs @@ -151,7 +151,7 @@ fn fold_enum( }, _) { let ast_variant = option::get( vec::find(ast_variants) {|v| - v.node.name == variant.name + *v.node.name == variant.name }); attr_parser::parse_desc(ast_variant.node.attrs) @@ -207,14 +207,14 @@ fn merge_method_attrs( node: ast::item_iface(_, _, methods), _ }, _) { par::seqmap(methods) {|method| - (method.ident, attr_parser::parse_desc(method.attrs)) + (*method.ident, attr_parser::parse_desc(method.attrs)) } } ast_map::node_item(@{ node: ast::item_impl(_, _, _, _, methods), _ }, _) { par::seqmap(methods) {|method| - (method.ident, attr_parser::parse_desc(method.attrs)) + (*method.ident, attr_parser::parse_desc(method.attrs)) } } _ { fail "unexpected item" } diff --git a/src/rustdoc/extract.rs b/src/rustdoc/extract.rs index 25bf5d6c64f..35e9fd5ea31 100644 --- a/src/rustdoc/extract.rs +++ b/src/rustdoc/extract.rs @@ -33,14 +33,14 @@ fn top_moddoc_from_crate( crate: @ast::crate, default_name: str ) -> doc::moddoc { - moddoc_from_mod(mk_itemdoc(ast::crate_node_id, default_name), + moddoc_from_mod(mk_itemdoc(ast::crate_node_id, @default_name), crate.node.module) } fn mk_itemdoc(id: ast::node_id, name: ast::ident) -> doc::itemdoc { { id: id, - name: name, + name: *name, path: [], brief: none, desc: none, @@ -169,7 +169,7 @@ fn variantdocs_from_variants( fn variantdoc_from_variant(variant: ast::variant) -> doc::variantdoc { { - name: variant.node.name, + name: *variant.node.name, desc: none, sig: none } @@ -210,7 +210,7 @@ fn ifacedoc_from_iface( item: itemdoc, methods: par::seqmap(methods) {|method| { - name: method.ident, + name: *method.ident, brief: none, desc: none, sections: [], @@ -242,7 +242,7 @@ fn impldoc_from_impl( self_ty: none, methods: par::seqmap(methods) {|method| { - name: method.ident, + name: *method.ident, brief: none, desc: none, sections: [], diff --git a/src/rustdoc/prune_unexported_pass.rs b/src/rustdoc/prune_unexported_pass.rs index 2c14271a630..0c4614adf1d 100644 --- a/src/rustdoc/prune_unexported_pass.rs +++ b/src/rustdoc/prune_unexported_pass.rs @@ -114,7 +114,7 @@ fn is_exported_from_mod( ast_map::node_item(item, _) { alt item.node { ast::item_mod(m) { - ast_util::is_exported(item_name, m) + ast_util::is_exported(@item_name, m) } _ { fail "is_exported_from_mod: not a mod"; @@ -131,7 +131,7 @@ fn is_exported_from_crate( item_name: str ) -> bool { astsrv::exec(srv) {|ctxt| - ast_util::is_exported(item_name, ctxt.ast.node.module) + ast_util::is_exported(@item_name, ctxt.ast.node.module) } } diff --git a/src/rustdoc/reexport_pass.rs b/src/rustdoc/reexport_pass.rs index 338c5d70f28..f9448bff082 100644 --- a/src/rustdoc/reexport_pass.rs +++ b/src/rustdoc/reexport_pass.rs @@ -187,7 +187,7 @@ fn build_reexport_path_map(srv: astsrv::srv, -def_map: def_map) -> path_map { if !def.reexp { cont; } alt def_map.find(def.id) { some(itemtag) { - reexportdocs += [(name, itemtag)]; + reexportdocs += [(*name, itemtag)]; } _ {} } @@ -231,9 +231,9 @@ fn find_reexport_impl_docs( some(ast_map::node_item(item, path)) { let path = ast_map::path_to_str(*path); if str::is_empty(path) { - item.ident + *item.ident } else { - path + "::" + item.ident + path + "::" + *item.ident } } _ { @@ -241,7 +241,7 @@ fn find_reexport_impl_docs( "" } }; - let ident = i.ident; + let ident = *i.ident; let doc = alt check def_map.find(i.did) { some(doc) { doc } }; diff --git a/src/rustdoc/tystr_pass.rs b/src/rustdoc/tystr_pass.rs index 289062ddcdf..85740205ffa 100644 --- a/src/rustdoc/tystr_pass.rs +++ b/src/rustdoc/tystr_pass.rs @@ -116,7 +116,7 @@ fn fold_enum( }, _) { let ast_variant = option::get( vec::find(ast_variants) {|v| - v.node.name == variant.name + *v.node.name == variant.name }); pprust::variant_to_str(ast_variant) @@ -151,7 +151,7 @@ fn fold_res( ast_map::node_item(@{ node: ast::item_res(decl, tys, _, _, _, rp), _ }, _) { - pprust::res_to_str(decl, doc.name(), tys, rp) + pprust::res_to_str(decl, @doc.name(), tys, rp) } } }) @@ -200,7 +200,7 @@ fn get_method_sig( node: ast::item_iface(_, _, methods), _ }, _) { alt check vec::find(methods) {|method| - method.ident == method_name + *method.ident == method_name } { some(method) { some(pprust::fun_to_str( @@ -215,7 +215,7 @@ fn get_method_sig( node: ast::item_impl(_, _, _, _, methods), _ }, _) { alt check vec::find(methods) {|method| - method.ident == method_name + *method.ident == method_name } { some(method) { some(pprust::fun_to_str( @@ -307,7 +307,7 @@ fn fold_type( }, _) { some(#fmt( "type %s%s = %s", - ident, + *ident, pprust::typarams_to_str(params), pprust::ty_to_str(ty) )) |
