@@ -2351,10 +2351,8 @@ impl<'a> State<'a> {
2351
2351
try!( self . print_fn_args ( decl, None ) ) ;
2352
2352
try!( word ( & mut self . s , "|" ) ) ;
2353
2353
2354
- if let ast:: Return ( ref ty) = decl. output {
2355
- if ty. node == ast:: TyInfer {
2356
- return self . maybe_print_comment ( ty. span . lo ) ;
2357
- }
2354
+ if let ast:: DefaultReturn ( ..) = decl. output {
2355
+ return Ok ( ( ) ) ;
2358
2356
}
2359
2357
2360
2358
try!( self . space_if_not_bol ( ) ) ;
@@ -2364,6 +2362,7 @@ impl<'a> State<'a> {
2364
2362
try!( self . print_type ( & * * ty) ) ;
2365
2363
self . maybe_print_comment ( ty. span . lo )
2366
2364
}
2365
+ ast:: DefaultReturn ( ..) => unreachable ! ( ) ,
2367
2366
ast:: NoReturn ( span) => {
2368
2367
try!( self . word_nbsp ( "!" ) ) ;
2369
2368
self . maybe_print_comment ( span. lo )
@@ -2385,10 +2384,8 @@ impl<'a> State<'a> {
2385
2384
try!( self . print_fn_args ( decl, None ) ) ;
2386
2385
try!( word ( & mut self . s , ")" ) ) ;
2387
2386
2388
- if let ast:: Return ( ref ty) = decl. output {
2389
- if ty. node == ast:: TyInfer {
2390
- return self . maybe_print_comment ( ty. span . lo ) ;
2391
- }
2387
+ if let ast:: DefaultReturn ( ..) = decl. output {
2388
+ return Ok ( ( ) ) ;
2392
2389
}
2393
2390
2394
2391
try!( self . space_if_not_bol ( ) ) ;
@@ -2398,6 +2395,7 @@ impl<'a> State<'a> {
2398
2395
try!( self . print_type ( & * * ty) ) ;
2399
2396
self . maybe_print_comment ( ty. span . lo )
2400
2397
}
2398
+ ast:: DefaultReturn ( ..) => unreachable ! ( ) ,
2401
2399
ast:: NoReturn ( span) => {
2402
2400
try!( self . word_nbsp ( "!" ) ) ;
2403
2401
self . maybe_print_comment ( span. lo )
@@ -2684,13 +2682,8 @@ impl<'a> State<'a> {
2684
2682
}
2685
2683
2686
2684
pub fn print_fn_output ( & mut self , decl : & ast:: FnDecl ) -> IoResult < ( ) > {
2687
- if let ast:: Return ( ref ty) = decl. output {
2688
- match ty. node {
2689
- ast:: TyTup ( ref tys) if tys. is_empty ( ) => {
2690
- return self . maybe_print_comment ( ty. span . lo ) ;
2691
- }
2692
- _ => ( )
2693
- }
2685
+ if let ast:: DefaultReturn ( ..) = decl. output {
2686
+ return Ok ( ( ) ) ;
2694
2687
}
2695
2688
2696
2689
try!( self . space_if_not_bol ( ) ) ;
@@ -2699,6 +2692,7 @@ impl<'a> State<'a> {
2699
2692
match decl. output {
2700
2693
ast:: NoReturn ( _) =>
2701
2694
try!( self . word_nbsp ( "!" ) ) ,
2695
+ ast:: DefaultReturn ( ..) => unreachable ! ( ) ,
2702
2696
ast:: Return ( ref ty) =>
2703
2697
try!( self . print_type ( & * * ty) )
2704
2698
}
@@ -3071,9 +3065,7 @@ mod test {
3071
3065
3072
3066
let decl = ast:: FnDecl {
3073
3067
inputs : Vec :: new ( ) ,
3074
- output : ast:: Return ( P ( ast:: Ty { id : 0 ,
3075
- node : ast:: TyTup ( vec ! [ ] ) ,
3076
- span : codemap:: DUMMY_SP } ) ) ,
3068
+ output : ast:: DefaultReturn ( codemap:: DUMMY_SP ) ,
3077
3069
variadic : false
3078
3070
} ;
3079
3071
let generics = ast_util:: empty_generics ( ) ;
0 commit comments