@@ -28,6 +28,8 @@ use std::gc::Gc;
28
28
pub enum PtrTy < ' a > {
29
29
/// &'lifetime mut
30
30
Borrowed ( Option < & ' a str > , ast:: Mutability ) ,
31
+ /// *mut
32
+ Raw ( ast:: Mutability ) ,
31
33
}
32
34
33
35
/// A path, e.g. `::std::option::Option::<int>` (global). Has support
@@ -82,7 +84,7 @@ impl<'a> Path<'a> {
82
84
}
83
85
}
84
86
85
- /// A type. Supports pointers (except for *) , Self, and literals
87
+ /// A type. Supports pointers, Self, and literals
86
88
#[ deriving( Clone ) ]
87
89
pub enum Ty < ' a > {
88
90
Self ,
@@ -143,6 +145,7 @@ impl<'a> Ty<'a> {
143
145
let lt = mk_lifetime ( cx, span, lt) ;
144
146
cx. ty_rptr ( span, raw_ty, lt, mutbl)
145
147
}
148
+ Raw ( mutbl) => cx. ty_ptr ( span, raw_ty, mutbl)
146
149
}
147
150
}
148
151
Literal ( ref p) => { p. to_ty ( cx, span, self_ty, self_generics) }
@@ -273,6 +276,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
273
276
let lt = lt. map ( |s| cx. lifetime ( span, cx. ident_of ( s) . name ) ) ;
274
277
ast:: SelfRegion ( lt, mutbl, special_idents:: self_)
275
278
}
279
+ Raw ( _) => cx. span_bug ( span, "attempted to use *self in deriving definition" )
276
280
} ) ;
277
281
let self_expr = cx. expr_deref ( span, self_path) ;
278
282
( self_expr, self_ty)
0 commit comments