@@ -788,9 +788,7 @@ module RustDataFlow implements InputSig<Location> {
788
788
(
789
789
LocalFlow:: localFlowStepCommon ( nodeFrom , nodeTo )
790
790
or
791
- exists ( SsaImpl:: DefinitionExt def , boolean isUseStep |
792
- SsaFlow:: localFlowStep ( def , nodeFrom , nodeTo , isUseStep )
793
- |
791
+ exists ( boolean isUseStep | SsaFlow:: localFlowStep ( _, nodeFrom , nodeTo , isUseStep ) |
794
792
isUseStep = false
795
793
or
796
794
isUseStep = true and
@@ -825,15 +823,13 @@ module RustDataFlow implements InputSig<Location> {
825
823
exists ( CrateOriginOption crate , string path |
826
824
resolveExtendedCanonicalPath ( p .getQualifier ( ) , crate , path ) and
827
825
v = MkVariantCanonicalPath ( crate , path , p .getPart ( ) .getNameRef ( ) .getText ( ) )
826
+ or
827
+ exists ( string name |
828
+ not p .hasQualifier ( ) and
829
+ resolveExtendedCanonicalPath ( p , crate , path + "::" + name ) and
830
+ v = MkVariantCanonicalPath ( crate , path , name )
831
+ )
828
832
)
829
- or
830
- // TODO: Remove once library types are extracted
831
- not p .hasQualifier ( ) and
832
- v = MkVariantCanonicalPath ( _, "crate::std::option::Option" , p .getPart ( ) .getNameRef ( ) .getText ( ) )
833
- or
834
- // TODO: Remove once library types are extracted
835
- not p .hasQualifier ( ) and
836
- v = MkVariantCanonicalPath ( _, "crate::std::result::Result" , p .getPart ( ) .getNameRef ( ) .getText ( ) )
837
833
}
838
834
839
835
/** Holds if `p` destructs an enum variant `v`. */
@@ -1099,20 +1095,22 @@ private module Cached {
1099
1095
cached
1100
1096
newtype TReturnKind = TNormalReturnKind ( )
1101
1097
1098
+ private CrateOriginOption langCoreCrate ( ) { result .asSome ( ) = "lang:core" }
1099
+
1102
1100
cached
1103
1101
newtype TVariantCanonicalPath =
1104
1102
MkVariantCanonicalPath ( CrateOriginOption crate , string path , string name ) {
1105
1103
variantHasExtendedCanonicalPath ( _, _, crate , path , name )
1106
1104
or
1107
1105
// TODO: Remove once library types are extracted
1108
- crate . isNone ( ) and
1109
- path = "crate::std::option::Option" and
1110
- name = "Some"
1111
- or
1112
- // TODO: Remove once library types are extracted
1113
- crate . isNone ( ) and
1114
- path = "crate::std::result::Result" and
1115
- name = [ "Ok" , "Err" ]
1106
+ crate = langCoreCrate ( ) and
1107
+ (
1108
+ path = "crate::option::Option" and
1109
+ name = "Some"
1110
+ or
1111
+ path = " crate::result::Result" and
1112
+ name = [ "Ok" , "Err" ]
1113
+ )
1116
1114
}
1117
1115
1118
1116
cached
@@ -1127,11 +1125,11 @@ private module Cached {
1127
1125
pos in [ 0 .. v .getVariant ( ) .getFieldList ( ) .( TupleFieldList ) .getNumberOfFields ( ) - 1 ]
1128
1126
or
1129
1127
// TODO: Remove once library types are extracted
1130
- v = MkVariantCanonicalPath ( _ , "crate::std ::option::Option" , "Some" ) and
1128
+ v = MkVariantCanonicalPath ( langCoreCrate ( ) , "crate::option::Option" , "Some" ) and
1131
1129
pos = 0
1132
1130
or
1133
1131
// TODO: Remove once library types are extracted
1134
- v = MkVariantCanonicalPath ( _ , "crate::std ::result::Result" , [ "Ok" , "Err" ] ) and
1132
+ v = MkVariantCanonicalPath ( langCoreCrate ( ) , "crate::result::Result" , [ "Ok" , "Err" ] ) and
1135
1133
pos = 0
1136
1134
} or
1137
1135
TVariantFieldContent ( VariantCanonicalPath v , string field ) {
0 commit comments