diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-10-28 14:48:52 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-11-03 17:41:00 -0500 |
| commit | 319d778ed306d0b3c35af79c47c702dbdebf6d09 (patch) | |
| tree | b1861eb5f0ab01a403c3fc93deea9244a72aded2 /src/libsyntax/ast_map/mod.rs | |
| parent | 01b81c0ebb45d36198fa8a78dcdcb8144e4bb06c (diff) | |
| download | rust-319d778ed306d0b3c35af79c47c702dbdebf6d09.tar.gz rust-319d778ed306d0b3c35af79c47c702dbdebf6d09.zip | |
Restructure AST so that the associated type definition carries
bounds like any other "type parameter".
Diffstat (limited to 'src/libsyntax/ast_map/mod.rs')
| -rw-r--r-- | src/libsyntax/ast_map/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index fa36577ebdb..f049b964ff3 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -405,7 +405,9 @@ impl<'ast> Map<'ast> { MethMac(_) => panic!("no path elem for {}", node), } } - TypeTraitItem(ref m) => PathName(m.ident.name), + TypeTraitItem(ref m) => { + PathName(m.ty_param.ident.name) + } }, NodeVariant(v) => PathName(v.node.name.name), _ => panic!("no path elem for {}", node) @@ -510,7 +512,7 @@ impl<'ast> Map<'ast> { match *trait_method { RequiredMethod(ref type_method) => type_method.span, ProvidedMethod(ref method) => method.span, - TypeTraitItem(ref typedef) => typedef.span, + TypeTraitItem(ref typedef) => typedef.ty_param.span, } } Some(NodeImplItem(ref impl_item)) => { @@ -650,7 +652,7 @@ impl Named for TraitItem { match *self { RequiredMethod(ref tm) => tm.ident.name, ProvidedMethod(ref m) => m.name(), - TypeTraitItem(ref at) => at.ident.name, + TypeTraitItem(ref at) => at.ty_param.ident.name, } } } @@ -783,7 +785,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> { self.insert(m.id, NodeTraitItem(tm)); } TypeTraitItem(ref typ) => { - self.insert(typ.id, NodeTraitItem(tm)); + self.insert(typ.ty_param.id, NodeTraitItem(tm)); } } } @@ -976,7 +978,7 @@ pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>, let trait_item_id = match *trait_item { ProvidedMethod(ref m) => m.id, RequiredMethod(ref m) => m.id, - TypeTraitItem(ref ty) => ty.id, + TypeTraitItem(ref ty) => ty.ty_param.id, }; collector.insert(trait_item_id, NodeTraitItem(trait_item)); @@ -1080,7 +1082,7 @@ fn node_id_to_string(map: &Map, id: NodeId) -> String { } TypeTraitItem(ref t) => { format!("type item {} in {} (id={})", - token::get_ident(t.ident), + token::get_ident(t.ty_param.ident), map.path_to_string(id), id) } |
