Use Names in the remaining HIR structures with exception of...

PathSegment, PatIdent, ExprWhile, ExprLoop, ExprBreak and ExprAgain - they need Idents for resolve
This commit is contained in:
Vadim Petrochenkov 2015-09-20 16:47:24 +03:00
parent a636a83caa
commit 2a779062d8
28 changed files with 86 additions and 86 deletions

View file

@ -494,7 +494,7 @@ pub struct TyParam {
impl Clean<TyParam> for hir::TyParam {
fn clean(&self, cx: &DocContext) -> TyParam {
TyParam {
name: self.ident.clean(cx),
name: self.name.clean(cx),
did: DefId { krate: LOCAL_CRATE, node: self.id },
bounds: self.bounds.clean(cx),
default: self.default.clean(cx),
@ -2547,7 +2547,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
PatStruct(ref name, ref fields, etc) => {
format!("{} {{ {}{} }}", path_to_string(name),
fields.iter().map(|&Spanned { node: ref fp, .. }|
format!("{}: {}", fp.ident, name_from_pat(&*fp.pat)))
format!("{}: {}", fp.name, name_from_pat(&*fp.pat)))
.collect::<Vec<String>>().join(", "),
if etc { ", ..." } else { "" }
)
@ -2840,7 +2840,7 @@ pub struct TypeBinding {
impl Clean<TypeBinding> for hir::TypeBinding {
fn clean(&self, cx: &DocContext) -> TypeBinding {
TypeBinding {
name: self.ident.clean(cx),
name: self.name.clean(cx),
ty: self.ty.clean(cx)
}
}

View file

@ -17,7 +17,7 @@ use syntax;
use syntax::codemap::Span;
use syntax::abi;
use syntax::ast;
use syntax::ast::{Ident, Name, NodeId};
use syntax::ast::{Name, NodeId};
use syntax::attr;
use syntax::ptr::P;
use rustc_front::hir;
@ -117,7 +117,7 @@ pub struct Enum {
}
pub struct Variant {
pub name: Ident,
pub name: Name,
pub attrs: Vec<ast::Attribute>,
pub kind: hir::VariantKind,
pub id: ast::NodeId,