@@ -82,16 +82,16 @@ impl Annotatable {
82
82
}
83
83
}
84
84
85
- pub fn expect_trait_item ( self ) -> P < ast:: TraitItem > {
85
+ pub fn expect_trait_item ( self ) -> ast:: TraitItem {
86
86
match self {
87
- Annotatable :: TraitItem ( i) => i,
87
+ Annotatable :: TraitItem ( i) => i. unwrap ( ) ,
88
88
_ => panic ! ( "expected Item" )
89
89
}
90
90
}
91
91
92
- pub fn expect_impl_item ( self ) -> P < ast:: ImplItem > {
92
+ pub fn expect_impl_item ( self ) -> ast:: ImplItem {
93
93
match self {
94
- Annotatable :: ImplItem ( i) => i,
94
+ Annotatable :: ImplItem ( i) => i. unwrap ( ) ,
95
95
_ => panic ! ( "expected Item" )
96
96
}
97
97
}
@@ -204,8 +204,8 @@ impl<F> IdentMacroExpander for F
204
204
macro_rules! make_stmts_default {
205
205
( $me: expr) => {
206
206
$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 ) ) )
209
209
} )
210
210
}
211
211
}
@@ -223,7 +223,7 @@ pub trait MacResult {
223
223
}
224
224
225
225
/// 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 > > {
227
227
None
228
228
}
229
229
@@ -236,7 +236,7 @@ pub trait MacResult {
236
236
///
237
237
/// By default this attempts to create an expression statement,
238
238
/// 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 > > {
240
240
make_stmts_default ! ( self )
241
241
}
242
242
@@ -273,8 +273,8 @@ make_MacEager! {
273
273
expr: P <ast:: Expr >,
274
274
pat: P <ast:: Pat >,
275
275
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 >,
278
278
ty: P <ast:: Ty >,
279
279
}
280
280
@@ -287,11 +287,11 @@ impl MacResult for MacEager {
287
287
self . items
288
288
}
289
289
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 > > {
291
291
self . impl_items
292
292
}
293
293
294
- fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < P < ast:: Stmt > > > {
294
+ fn make_stmts ( self : Box < Self > ) -> Option < SmallVector < ast:: Stmt > > {
295
295
match self . stmts . as_ref ( ) . map_or ( 0 , |s| s. len ( ) ) {
296
296
0 => make_stmts_default ! ( self ) ,
297
297
_ => self . stmts ,
@@ -391,19 +391,19 @@ impl MacResult for DummyResult {
391
391
}
392
392
}
393
393
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 > > {
395
395
if self . expr_only {
396
396
None
397
397
} else {
398
398
Some ( SmallVector :: zero ( ) )
399
399
}
400
400
}
401
401
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 (
404
404
codemap:: respan ( self . span ,
405
405
ast:: StmtKind :: Expr ( DummyResult :: raw_expr ( self . span ) ,
406
- ast:: DUMMY_NODE_ID ) ) ) ) )
406
+ ast:: DUMMY_NODE_ID ) ) ) )
407
407
}
408
408
}
409
409
0 commit comments