@@ -82,16 +82,16 @@ impl Annotatable {
8282 }
8383 }
8484
85- pub fn expect_trait_item ( self ) -> P < ast:: TraitItem > {
85+ pub fn expect_trait_item ( self ) -> ast:: TraitItem {
8686 match self {
87- Annotatable :: TraitItem ( i) => i,
87+ Annotatable :: TraitItem ( i) => i. unwrap ( ) ,
8888 _ => panic ! ( "expected Item" )
8989 }
9090 }
9191
92- pub fn expect_impl_item ( self ) -> P < ast:: ImplItem > {
92+ pub fn expect_impl_item ( self ) -> ast:: ImplItem {
9393 match self {
94- Annotatable :: ImplItem ( i) => i,
94+ Annotatable :: ImplItem ( i) => i. unwrap ( ) ,
9595 _ => panic ! ( "expected Item" )
9696 }
9797 }
@@ -204,8 +204,8 @@ impl<F> IdentMacroExpander for F
204204macro_rules! make_stmts_default {
205205 ( $me: expr) => {
206206 $me. make_expr( ) . map( |e| {
207- SmallVector :: one( P ( codemap:: respan(
208- e. span, ast:: StmtKind :: Expr ( e, ast:: DUMMY_NODE_ID ) ) ) )
207+ SmallVector :: one( codemap:: respan(
208+ e. span, ast:: StmtKind :: Expr ( e, ast:: DUMMY_NODE_ID ) ) )
209209 } )
210210 }
211211}
@@ -223,7 +223,7 @@ pub trait MacResult {
223223 }
224224
225225 /// Create zero or more impl items.
226- fn make_impl_items ( self : Box < Self > ) -> Option < SmallVector < P < ast:: ImplItem > > > {
226+ fn make_impl_items ( self : Box < Self > ) -> Option < SmallVector < ast:: ImplItem > > {
227227 None
228228 }
229229
@@ -236,7 +236,7 @@ pub trait MacResult {
236236 ///
237237 /// By default this attempts to create an expression statement,
238238 /// returning None if that fails.
239- fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < P < ast:: Stmt > > > {
239+ fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < ast:: Stmt > > {
240240 make_stmts_default ! ( self )
241241 }
242242
@@ -273,8 +273,8 @@ make_MacEager! {
273273 expr: P <ast:: Expr >,
274274 pat: P <ast:: Pat >,
275275 items: SmallVector <P <ast:: Item >>,
276- impl_items: SmallVector <P < ast:: ImplItem > >,
277- stmts: SmallVector <P < ast:: Stmt > >,
276+ impl_items: SmallVector <ast:: ImplItem >,
277+ stmts: SmallVector <ast:: Stmt >,
278278 ty: P <ast:: Ty >,
279279}
280280
@@ -287,11 +287,11 @@ impl MacResult for MacEager {
287287 self . items
288288 }
289289
290- fn make_impl_items ( self : Box < Self > ) -> Option < SmallVector < P < ast:: ImplItem > > > {
290+ fn make_impl_items ( self : Box < Self > ) -> Option < SmallVector < ast:: ImplItem > > {
291291 self . impl_items
292292 }
293293
294- fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < P < ast:: Stmt > > > {
294+ fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < ast:: Stmt > > {
295295 match self . stmts . as_ref ( ) . map_or ( 0 , |s| s. len ( ) ) {
296296 0 => make_stmts_default ! ( self ) ,
297297 _ => self . stmts ,
@@ -391,19 +391,19 @@ impl MacResult for DummyResult {
391391 }
392392 }
393393
394- fn make_impl_items ( self : Box < DummyResult > ) -> Option < SmallVector < P < ast:: ImplItem > > > {
394+ fn make_impl_items ( self : Box < DummyResult > ) -> Option < SmallVector < ast:: ImplItem > > {
395395 if self . expr_only {
396396 None
397397 } else {
398398 Some ( SmallVector :: zero ( ) )
399399 }
400400 }
401401
402- fn make_stmts ( self : Box < DummyResult > ) -> Option < SmallVector < P < ast:: Stmt > > > {
403- Some ( SmallVector :: one ( P (
402+ fn make_stmts ( self : Box < DummyResult > ) -> Option < SmallVector < ast:: Stmt > > {
403+ Some ( SmallVector :: one (
404404 codemap:: respan ( self . span ,
405405 ast:: StmtKind :: Expr ( DummyResult :: raw_expr ( self . span ) ,
406- ast:: DUMMY_NODE_ID ) ) ) ) )
406+ ast:: DUMMY_NODE_ID ) ) ) )
407407 }
408408}
409409
0 commit comments