@@ -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
@@ -823,19 +821,9 @@ module RustDataFlow implements InputSig<Location> {
823
821
/** Holds if path `p` resolves to variant `v`. */
824
822
private predicate pathResolveToVariantCanonicalPath ( PathAstNode p , VariantCanonicalPath v ) {
825
823
exists ( CrateOriginOption crate , string path , string name |
826
- // TODO: this is bad, but will be solved by moving to semantic paths away from strings
827
824
resolveExtendedCanonicalPath ( p , crate , path + "::" + name ) and
828
825
v = MkVariantCanonicalPath ( crate , path , name )
829
826
)
830
- or
831
- // TODO: Remove once library types are extracted
832
- exists ( Path path |
833
- path = p .getPath ( ) and
834
- not path .hasQualifier ( ) and
835
- v =
836
- MkVariantCanonicalPath ( _, [ "crate::std::option::Option" , "crate::std::result::Result" ] ,
837
- path .getPart ( ) .getNameRef ( ) .getText ( ) )
838
- )
839
827
}
840
828
841
829
/** Holds if `p` destructs an enum variant `v`. */
@@ -1101,20 +1089,22 @@ private module Cached {
1101
1089
cached
1102
1090
newtype TReturnKind = TNormalReturnKind ( )
1103
1091
1092
+ private CrateOriginOption langCoreCrate ( ) { result .asSome ( ) = "lang:core" }
1093
+
1104
1094
cached
1105
1095
newtype TVariantCanonicalPath =
1106
1096
MkVariantCanonicalPath ( CrateOriginOption crate , string path , string name ) {
1107
1097
variantHasExtendedCanonicalPath ( _, _, crate , path , name )
1108
1098
or
1109
1099
// TODO: Remove once library types are extracted
1110
- crate . isNone ( ) and
1111
- path = "crate::std::option::Option" and
1112
- name = "Some"
1113
- or
1114
- // TODO: Remove once library types are extracted
1115
- crate . isNone ( ) and
1116
- path = "crate::std::result::Result" and
1117
- name = [ "Ok" , "Err" ]
1100
+ crate = langCoreCrate ( ) and
1101
+ (
1102
+ path = "crate::option::Option" and
1103
+ name = "Some"
1104
+ or
1105
+ path = " crate::result::Result" and
1106
+ name = [ "Ok" , "Err" ]
1107
+ )
1118
1108
}
1119
1109
1120
1110
cached
@@ -1129,11 +1119,11 @@ private module Cached {
1129
1119
pos in [ 0 .. v .getVariant ( ) .getFieldList ( ) .( TupleFieldList ) .getNumberOfFields ( ) - 1 ]
1130
1120
or
1131
1121
// TODO: Remove once library types are extracted
1132
- v = MkVariantCanonicalPath ( _ , "crate::std ::option::Option" , "Some" ) and
1122
+ v = MkVariantCanonicalPath ( langCoreCrate ( ) , "crate::option::Option" , "Some" ) and
1133
1123
pos = 0
1134
1124
or
1135
1125
// TODO: Remove once library types are extracted
1136
- v = MkVariantCanonicalPath ( _ , "crate::std ::result::Result" , [ "Ok" , "Err" ] ) and
1126
+ v = MkVariantCanonicalPath ( langCoreCrate ( ) , "crate::result::Result" , [ "Ok" , "Err" ] ) and
1137
1127
pos = 0
1138
1128
} or
1139
1129
TVariantFieldContent ( VariantCanonicalPath v , string field ) {
0 commit comments