File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ impl<'tcx> Body<'tcx> {
242242 pub fn vars_iter < ' a > ( & ' a self ) -> impl Iterator < Item = Local > + ' a {
243243 ( self . arg_count + 1 ..self . local_decls . len ( ) ) . filter_map ( move |index| {
244244 let local = Local :: new ( index) ;
245- self . local_decls [ local] . is_user_variable ( ) . to_option ( local)
245+ self . local_decls [ local] . is_user_variable ( ) . then_some ( local)
246246 } )
247247 }
248248
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2828#![ feature( associated_type_bounds) ]
2929#![ feature( range_is_empty) ]
3030#![ feature( stmt_expr_attributes) ]
31- #![ feature( bool_to_option) ]
3231#![ feature( trait_alias) ]
3332#![ feature( matches_macro) ]
3433
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn get_switched_on_type<'tcx>(
2929 // Only bother checking blocks which terminate by switching on a local.
3030 if let Some ( local) = get_discriminant_local ( & terminator. kind ) {
3131 let stmt_before_term = ( block_data. statements . len ( ) > 0 )
32- . then_with ( || & block_data. statements [ block_data. statements . len ( ) - 1 ] . kind ) ;
32+ . then ( || & block_data. statements [ block_data. statements . len ( ) - 1 ] . kind ) ;
3333
3434 if let Some ( StatementKind :: Assign ( box ( l, Rvalue :: Discriminant ( place) ) ) ) = stmt_before_term
3535 {
@@ -59,7 +59,7 @@ fn variant_discriminants<'tcx>(
5959 . iter_enumerated ( )
6060 . filter_map ( |( idx, layout) | {
6161 ( layout. abi != Abi :: Uninhabited )
62- . then_with ( || ty. discriminant_for_variant ( tcx, idx) . unwrap ( ) . val )
62+ . then ( || ty. discriminant_for_variant ( tcx, idx) . unwrap ( ) . val )
6363 } )
6464 . collect ( ) ,
6565 }
Original file line number Diff line number Diff line change 11//! The main parser interface.
22
3+ #![ feature( bool_to_option) ]
34#![ feature( crate_visibility_modifier) ]
45
56use syntax:: ast;
You can’t perform that action at this time.
0 commit comments