@@ -919,15 +919,15 @@ impl<'tcx> LocalDecl<'tcx> {
919
919
/// - or `match ... { C(x) => ... }`
920
920
pub fn can_be_made_mutable ( & self ) -> bool {
921
921
matches ! (
922
- self . local_info,
923
- ClearCrossCrate :: Set ( box LocalInfo :: User (
922
+ self . local_info( ) ,
923
+ LocalInfo :: User (
924
924
BindingForm :: Var ( VarBindingForm {
925
925
binding_mode: ty:: BindingMode :: BindByValue ( _) ,
926
926
opt_ty_info: _,
927
927
opt_match_place: _,
928
928
pat_span: _,
929
929
} ) | BindingForm :: ImplicitSelf ( ImplicitSelfKind :: Imm ) ,
930
- ) )
930
+ )
931
931
)
932
932
}
933
933
@@ -936,56 +936,51 @@ impl<'tcx> LocalDecl<'tcx> {
936
936
/// mutable bindings, but the inverse does not necessarily hold).
937
937
pub fn is_nonref_binding ( & self ) -> bool {
938
938
matches ! (
939
- self . local_info,
940
- ClearCrossCrate :: Set ( box LocalInfo :: User (
939
+ self . local_info( ) ,
940
+ LocalInfo :: User (
941
941
BindingForm :: Var ( VarBindingForm {
942
942
binding_mode: ty:: BindingMode :: BindByValue ( _) ,
943
943
opt_ty_info: _,
944
944
opt_match_place: _,
945
945
pat_span: _,
946
946
} ) | BindingForm :: ImplicitSelf ( _) ,
947
- ) )
947
+ )
948
948
)
949
949
}
950
950
951
951
/// Returns `true` if this variable is a named variable or function
952
952
/// parameter declared by the user.
953
953
#[ inline]
954
954
pub fn is_user_variable ( & self ) -> bool {
955
- matches ! ( self . local_info, ClearCrossCrate :: Set ( box LocalInfo :: User ( _) ) )
955
+ matches ! ( self . local_info( ) , LocalInfo :: User ( _) )
956
956
}
957
957
958
958
/// Returns `true` if this is a reference to a variable bound in a `match`
959
959
/// expression that is used to access said variable for the guard of the
960
960
/// match arm.
961
961
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 ) )
966
963
}
967
964
968
965
/// Returns `Some` if this is a reference to a static item that is used to
969
966
/// access that static.
970
967
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 { .. } )
972
969
}
973
970
974
971
/// Returns `Some` if this is a reference to a thread-local static item that is used to
975
972
/// access that static.
976
973
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,
981
976
_ => false ,
982
977
}
983
978
}
984
979
985
980
/// Returns `true` if this is a DerefTemp
986
981
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 ,
989
984
_ => ( ) ,
990
985
}
991
986
return false ;
0 commit comments