diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-03 09:53:37 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-03 11:34:12 +0100 |
| commit | 43ce38375d95fcc33c550037bfb96ef2a75ce253 (patch) | |
| tree | a5a97ce956600bdabf764773cd1b94b1134238bc /src/rustdoc | |
| parent | c1b075d042cabb90f804f3d73e6a4f4b512aa697 (diff) | |
| download | rust-43ce38375d95fcc33c550037bfb96ef2a75ce253.tar.gz rust-43ce38375d95fcc33c550037bfb96ef2a75ce253.zip | |
Store item paths in ast_map, get rid of trans::local_ctxt
The direct motivation for this was that the monomorphizer needs to be able to generate sane symbols for random items. The typechecker can probably also use this in the future to provide more useful error messages.
Diffstat (limited to 'src/rustdoc')
| -rw-r--r-- | src/rustdoc/attr_pass.rs | 8 | ||||
| -rw-r--r-- | src/rustdoc/prune_unexported_pass.rs | 2 | ||||
| -rw-r--r-- | src/rustdoc/tystr_pass.rs | 30 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/rustdoc/attr_pass.rs b/src/rustdoc/attr_pass.rs index 3d12fdaaa67..e95a256fe04 100644 --- a/src/rustdoc/attr_pass.rs +++ b/src/rustdoc/attr_pass.rs @@ -67,7 +67,7 @@ fn parse_item_attrs<T>( parse_attrs: fn~([ast::attribute]) -> T) -> T { astsrv::exec(srv) {|ctxt| let attrs = alt ctxt.ast_map.get(id) { - ast_map::node_item(item) { item.attrs } + ast_map::node_item(item, _) { item.attrs } _ { fail "parse_item_attrs: not an item"; } @@ -246,7 +246,7 @@ fn fold_enum( alt ctxt.ast_map.get(doc.id) { ast_map::node_item(@{ node: ast::item_enum(ast_variants, _), _ - }) { + }, _) { let ast_variant = option::get( vec::find(ast_variants) {|v| v.node.name == variant.name @@ -351,14 +351,14 @@ fn merge_method_attrs( alt ctxt.ast_map.get(item_id) { ast_map::node_item(@{ node: ast::item_iface(_, methods), _ - }) { + }, _) { vec::map(methods) {|method| (method.ident, attr_parser::parse_method(method.attrs)) } } ast_map::node_item(@{ node: ast::item_impl(_, _, _, methods), _ - }) { + }, _) { vec::map(methods) {|method| (method.ident, attr_parser::parse_method(method.attrs)) } diff --git a/src/rustdoc/prune_unexported_pass.rs b/src/rustdoc/prune_unexported_pass.rs index 110b6952e96..41a035770b6 100644 --- a/src/rustdoc/prune_unexported_pass.rs +++ b/src/rustdoc/prune_unexported_pass.rs @@ -106,7 +106,7 @@ fn is_exported_from_mod( ) -> bool { astsrv::exec(srv) {|ctxt| alt ctxt.ast_map.get(mod_id) { - ast_map::node_item(item) { + ast_map::node_item(item, _) { alt item.node { ast::item_mod(m) { ast_util::is_exported(item_name, m) diff --git a/src/rustdoc/tystr_pass.rs b/src/rustdoc/tystr_pass.rs index a80905538b2..58cbff8edb2 100644 --- a/src/rustdoc/tystr_pass.rs +++ b/src/rustdoc/tystr_pass.rs @@ -49,7 +49,7 @@ fn get_fn_sig(srv: astsrv::srv, fn_id: doc::ast_id) -> option<str> { ast_map::node_item(@{ ident: ident, node: ast::item_fn(decl, _, blk), _ - }) { + }, _) { some(pprust::fun_to_str(decl, ident, [])) } _ { @@ -86,7 +86,7 @@ fn get_ret_ty(srv: astsrv::srv, fn_id: doc::ast_id) -> option<str> { alt ctxt.ast_map.get(fn_id) { ast_map::node_item(@{ node: ast::item_fn(decl, _, _), _ - }) { + }, _) { ret_ty_to_str(decl) } _ { fail "get_ret_ty: undocumented invariant"; } @@ -136,10 +136,10 @@ fn get_arg_tys(srv: astsrv::srv, fn_id: doc::ast_id) -> [(str, str)] { alt ctxt.ast_map.get(fn_id) { ast_map::node_item(@{ node: ast::item_fn(decl, _, _), _ - }) | + }, _) | ast_map::node_item(@{ node: ast::item_res(decl, _, _, _, _), _ - }) { + }, _) { decl_arg_tys(decl) } _ { @@ -174,7 +174,7 @@ fn fold_const( alt ctxt.ast_map.get(doc.id) { ast_map::node_item(@{ node: ast::item_const(ty, _), _ - }) { + }, _) { pprust::ty_to_str(ty) } _ { @@ -204,7 +204,7 @@ fn fold_enum( alt ctxt.ast_map.get(doc.id) { ast_map::node_item(@{ node: ast::item_enum(ast_variants, _), _ - }) { + }, _) { let ast_variant = option::get( vec::find(ast_variants) {|v| v.node.name == variant.name @@ -243,7 +243,7 @@ fn fold_res( alt ctxt.ast_map.get(doc.id) { ast_map::node_item(@{ node: ast::item_res(decl, _, _, _, _), _ - }) { + }, _) { pprust::res_to_str(decl, doc.name, []) } _ { fail "fold_res: undocumented invariant"; } @@ -324,7 +324,7 @@ fn get_method_ret_ty( alt ctxt.ast_map.get(item_id) { ast_map::node_item(@{ node: ast::item_iface(_, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -336,7 +336,7 @@ fn get_method_ret_ty( } ast_map::node_item(@{ node: ast::item_impl(_, _, _, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -360,7 +360,7 @@ fn get_method_sig( alt ctxt.ast_map.get(item_id) { ast_map::node_item(@{ node: ast::item_iface(_, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -372,7 +372,7 @@ fn get_method_sig( } ast_map::node_item(@{ node: ast::item_impl(_, _, _, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -412,7 +412,7 @@ fn get_method_arg_tys( alt ctxt.ast_map.get(item_id) { ast_map::node_item(@{ node: ast::item_iface(_, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -424,7 +424,7 @@ fn get_method_arg_tys( } ast_map::node_item(@{ node: ast::item_impl(_, _, _, methods), _ - }) { + }, _) { alt vec::find(methods) {|method| method.ident == method_name } { @@ -476,7 +476,7 @@ fn fold_impl( alt ctxt.ast_map.get(doc.id) { ast_map::node_item(@{ node: ast::item_impl(_, iface_ty, self_ty, _), _ - }) { + }, _) { let iface_ty = option::map(iface_ty) {|iface_ty| pprust::ty_to_str(iface_ty) }; @@ -551,7 +551,7 @@ fn fold_type( ast_map::node_item(@{ ident: ident, node: ast::item_ty(ty, params), _ - }) { + }, _) { some(#fmt( "type %s%s = %s", ident, |
