@@ -37,6 +37,7 @@ pub enum AnnNode<'a> {
37
37
NodeName ( & ' a ast:: Name ) ,
38
38
NodeBlock ( & ' a ast:: Block ) ,
39
39
NodeItem ( & ' a ast:: Item ) ,
40
+ NodeSubItem ( ast:: NodeId ) ,
40
41
NodeExpr ( & ' a ast:: Expr ) ,
41
42
NodePat ( & ' a ast:: Pat ) ,
42
43
}
@@ -1264,6 +1265,7 @@ impl<'a> State<'a> {
1264
1265
1265
1266
pub fn print_trait_item ( & mut self , ti : & ast:: TraitItem )
1266
1267
-> io:: Result < ( ) > {
1268
+ try!( self . ann . pre ( self , NodeSubItem ( ti. id ) ) ) ;
1267
1269
try!( self . hardbreak_if_not_bol ( ) ) ;
1268
1270
try!( self . maybe_print_comment ( ti. span . lo ) ) ;
1269
1271
try!( self . print_outer_attributes ( & ti. attrs ) ) ;
@@ -1275,19 +1277,21 @@ impl<'a> State<'a> {
1275
1277
try!( self . print_method_sig ( ti. ident , sig, ast:: Inherited ) ) ;
1276
1278
if let Some ( ref body) = * body {
1277
1279
try!( self . nbsp ( ) ) ;
1278
- self . print_block_with_attrs ( body, & ti. attrs )
1280
+ try! ( self . print_block_with_attrs ( body, & ti. attrs ) ) ;
1279
1281
} else {
1280
- word ( & mut self . s , ";" )
1282
+ try! ( word ( & mut self . s , ";" ) ) ;
1281
1283
}
1282
1284
}
1283
1285
ast:: TypeTraitItem ( ref bounds, ref default) => {
1284
- self . print_associated_type ( ti. ident , Some ( bounds) ,
1285
- default. as_ref ( ) . map ( |ty| & * * ty) )
1286
+ try! ( self . print_associated_type ( ti. ident , Some ( bounds) ,
1287
+ default. as_ref ( ) . map ( |ty| & * * ty) ) ) ;
1286
1288
}
1287
1289
}
1290
+ self . ann . post ( self , NodeSubItem ( ti. id ) )
1288
1291
}
1289
1292
1290
1293
pub fn print_impl_item ( & mut self , ii : & ast:: ImplItem ) -> io:: Result < ( ) > {
1294
+ try!( self . ann . pre ( self , NodeSubItem ( ii. id ) ) ) ;
1291
1295
try!( self . hardbreak_if_not_bol ( ) ) ;
1292
1296
try!( self . maybe_print_comment ( ii. span . lo ) ) ;
1293
1297
try!( self . print_outer_attributes ( & ii. attrs ) ) ;
@@ -1296,10 +1300,10 @@ impl<'a> State<'a> {
1296
1300
try!( self . head ( "" ) ) ;
1297
1301
try!( self . print_method_sig ( ii. ident , sig, ii. vis ) ) ;
1298
1302
try!( self . nbsp ( ) ) ;
1299
- self . print_block_with_attrs ( body, & ii. attrs )
1303
+ try! ( self . print_block_with_attrs ( body, & ii. attrs ) ) ;
1300
1304
}
1301
1305
ast:: TypeImplItem ( ref ty) => {
1302
- self . print_associated_type ( ii. ident , None , Some ( ty) )
1306
+ try! ( self . print_associated_type ( ii. ident , None , Some ( ty) ) ) ;
1303
1307
}
1304
1308
ast:: MacImplItem ( codemap:: Spanned { node : ast:: MacInvocTT ( ref pth, ref tts, _) ,
1305
1309
..} ) => {
@@ -1311,9 +1315,10 @@ impl<'a> State<'a> {
1311
1315
try!( self . print_tts ( & tts[ ..] ) ) ;
1312
1316
try!( self . pclose ( ) ) ;
1313
1317
try!( word ( & mut self . s , ";" ) ) ;
1314
- self . end ( )
1318
+ try! ( self . end ( ) )
1315
1319
}
1316
1320
}
1321
+ self . ann . post ( self , NodeSubItem ( ii. id ) )
1317
1322
}
1318
1323
1319
1324
pub fn print_outer_attributes ( & mut self ,
0 commit comments