}
pub struct field_ty {
- ident: Ident,
+ name: Name,
id: DefId,
vis: ast::visibility,
}
ty_struct(def_id, ref substs) => {
let fields = struct_fields(cx, def_id, substs);
fields.len() == 1 &&
- fields[0].ident == token::special_idents::unnamed_field &&
+ fields[0].ident.name == token::special_idents::unnamed_field.name &&
type_is_immediate(cx, fields[0].mt.ty)
}
_ => false
match field.node.kind {
named_field(ident, visibility) => {
field_ty {
- ident: ident,
+ name: ident.name,
id: ast_util::local_def(field.node.id),
vis: visibility,
}
}
unnamed_field => {
field_ty {
- ident:
- syntax::parse::token::special_idents::unnamed_field,
+ name:
+ syntax::parse::token::special_idents::unnamed_field.name,
id: ast_util::local_def(field.node.id),
vis: ast::public,
}
-> ~[field] {
do lookup_struct_fields(cx, did).map |f| {
field {
- ident: f.ident,
+ // FIXME #6993: change type of field to Name and get rid of new()
+ ident: ast::Ident::new(f.name),
mt: mt {
ty: lookup_field_type(cx, did, f.id, substs),
mutbl: MutImmutable
static tycat_int: int = 3;
static tycat_float: int = 4;
static tycat_bot: int = 5;
+ static tycat_raw_ptr: int = 6;
static opcat_add: int = 0;
static opcat_sub: int = 1;
ty_int(_) | ty_uint(_) | ty_infer(IntVar(_)) => tycat_int,
ty_float(_) | ty_infer(FloatVar(_)) => tycat_float,
ty_bot => tycat_bot,
+ ty_ptr(_) => tycat_raw_ptr,
_ => tycat_other
}
}
/*char*/ [f, f, f, f, t, t, f, f],
/*int*/ [t, t, t, t, t, t, t, f],
/*float*/ [t, t, t, f, t, t, f, f],
- /*bot*/ [t, t, t, t, f, f, t, t]];
+ /*bot*/ [t, t, t, t, f, f, t, t],
+ /*raw ptr*/ [f, f, f, f, t, t, f, f]];
return tbl[tycat(cx, ty)][opcat(op)];
}