File tree 4 files changed +4
-4
lines changed
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> {
242
242
pub fn vars_iter < ' a > ( & ' a self ) -> impl Iterator < Item = Local > + ' a {
243
243
( self . arg_count + 1 ..self . local_decls . len ( ) ) . filter_map ( move |index| {
244
244
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)
246
246
} )
247
247
}
248
248
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
28
28
#![ feature( associated_type_bounds) ]
29
29
#![ feature( range_is_empty) ]
30
30
#![ feature( stmt_expr_attributes) ]
31
- #![ feature( bool_to_option) ]
32
31
#![ feature( trait_alias) ]
33
32
#![ feature( matches_macro) ]
34
33
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn get_switched_on_type<'tcx>(
29
29
// Only bother checking blocks which terminate by switching on a local.
30
30
if let Some ( local) = get_discriminant_local ( & terminator. kind ) {
31
31
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 ) ;
33
33
34
34
if let Some ( StatementKind :: Assign ( box ( l, Rvalue :: Discriminant ( place) ) ) ) = stmt_before_term
35
35
{
@@ -59,7 +59,7 @@ fn variant_discriminants<'tcx>(
59
59
. iter_enumerated ( )
60
60
. filter_map ( |( idx, layout) | {
61
61
( 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 )
63
63
} )
64
64
. collect ( ) ,
65
65
}
Original file line number Diff line number Diff line change 1
1
//! The main parser interface.
2
2
3
+ #![ feature( bool_to_option) ]
3
4
#![ feature( crate_visibility_modifier) ]
4
5
5
6
use syntax:: ast;
You can’t perform that action at this time.
0 commit comments