@@ -28,6 +28,8 @@ use std::gc::Gc;
2828pub enum PtrTy < ' a > {
2929 /// &'lifetime mut
3030 Borrowed ( Option < & ' a str > , ast:: Mutability ) ,
31+ /// *mut
32+ Raw ( ast:: Mutability ) ,
3133}
3234
3335/// A path, e.g. `::std::option::Option::<int>` (global). Has support
@@ -82,7 +84,7 @@ impl<'a> Path<'a> {
8284 }
8385}
8486
85- /// A type. Supports pointers (except for *) , Self, and literals
87+ /// A type. Supports pointers, Self, and literals
8688#[ deriving( Clone ) ]
8789pub enum Ty < ' a > {
8890 Self ,
@@ -143,6 +145,7 @@ impl<'a> Ty<'a> {
143145 let lt = mk_lifetime ( cx, span, lt) ;
144146 cx. ty_rptr ( span, raw_ty, lt, mutbl)
145147 }
148+ Raw ( mutbl) => cx. ty_ptr ( span, raw_ty, mutbl)
146149 }
147150 }
148151 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>)
273276 let lt = lt. map ( |s| cx. lifetime ( span, cx. ident_of ( s) . name ) ) ;
274277 ast:: SelfRegion ( lt, mutbl, special_idents:: self_)
275278 }
279+ Raw ( _) => cx. span_bug ( span, "attempted to use *self in deriving definition" )
276280 } ) ;
277281 let self_expr = cx. expr_deref ( span, self_path) ;
278282 ( self_expr, self_ty)
0 commit comments