@@ -919,15 +919,15 @@ impl<'tcx> LocalDecl<'tcx> {
919919 /// - or `match ... { C(x) => ... }`
920920 pub fn can_be_made_mutable ( & self ) -> bool {
921921 matches ! (
922- self . local_info,
923- ClearCrossCrate :: Set ( box LocalInfo :: User (
922+ self . local_info( ) ,
923+ LocalInfo :: User (
924924 BindingForm :: Var ( VarBindingForm {
925925 binding_mode: ty:: BindingMode :: BindByValue ( _) ,
926926 opt_ty_info: _,
927927 opt_match_place: _,
928928 pat_span: _,
929929 } ) | BindingForm :: ImplicitSelf ( ImplicitSelfKind :: Imm ) ,
930- ) )
930+ )
931931 )
932932 }
933933
@@ -936,56 +936,51 @@ impl<'tcx> LocalDecl<'tcx> {
936936 /// mutable bindings, but the inverse does not necessarily hold).
937937 pub fn is_nonref_binding ( & self ) -> bool {
938938 matches ! (
939- self . local_info,
940- ClearCrossCrate :: Set ( box LocalInfo :: User (
939+ self . local_info( ) ,
940+ LocalInfo :: User (
941941 BindingForm :: Var ( VarBindingForm {
942942 binding_mode: ty:: BindingMode :: BindByValue ( _) ,
943943 opt_ty_info: _,
944944 opt_match_place: _,
945945 pat_span: _,
946946 } ) | BindingForm :: ImplicitSelf ( _) ,
947- ) )
947+ )
948948 )
949949 }
950950
951951 /// Returns `true` if this variable is a named variable or function
952952 /// parameter declared by the user.
953953 #[ inline]
954954 pub fn is_user_variable ( & self ) -> bool {
955- matches ! ( self . local_info, ClearCrossCrate :: Set ( box LocalInfo :: User ( _) ) )
955+ matches ! ( self . local_info( ) , LocalInfo :: User ( _) )
956956 }
957957
958958 /// Returns `true` if this is a reference to a variable bound in a `match`
959959 /// expression that is used to access said variable for the guard of the
960960 /// match arm.
961961 pub fn is_ref_for_guard ( & self ) -> bool {
962- matches ! (
963- self . local_info,
964- ClearCrossCrate :: Set ( box LocalInfo :: User ( BindingForm :: RefForGuard ) )
965- )
962+ matches ! ( self . local_info( ) , LocalInfo :: User ( BindingForm :: RefForGuard ) )
966963 }
967964
968965 /// Returns `Some` if this is a reference to a static item that is used to
969966 /// access that static.
970967 pub fn is_ref_to_static ( & self ) -> bool {
971- matches ! ( self . local_info, ClearCrossCrate :: Set ( box LocalInfo :: StaticRef { .. } ) )
968+ matches ! ( self . local_info( ) , LocalInfo :: StaticRef { .. } )
972969 }
973970
974971 /// Returns `Some` if this is a reference to a thread-local static item that is used to
975972 /// access that static.
976973 pub fn is_ref_to_thread_local ( & self ) -> bool {
977- match self . local_info {
978- ClearCrossCrate :: Set ( box LocalInfo :: StaticRef { is_thread_local, .. } ) => {
979- is_thread_local
980- }
974+ match self . local_info ( ) {
975+ LocalInfo :: StaticRef { is_thread_local, .. } => * is_thread_local,
981976 _ => false ,
982977 }
983978 }
984979
985980 /// Returns `true` if this is a DerefTemp
986981 pub fn is_deref_temp ( & self ) -> bool {
987- match self . local_info {
988- ClearCrossCrate :: Set ( box LocalInfo :: DerefTemp ) => return true ,
982+ match self . local_info ( ) {
983+ LocalInfo :: DerefTemp => return true ,
989984 _ => ( ) ,
990985 }
991986 return false ;
0 commit comments