File tree Expand file tree Collapse file tree 2 files changed +106
-149
lines changed Expand file tree Collapse file tree 2 files changed +106
-149
lines changed Original file line number Diff line number Diff line change @@ -1074,6 +1074,13 @@ class LifetimeDependenceChecker {
1074
1074
return ;
1075
1075
}
1076
1076
if (afd->getParameters ()->size () > 0 ) {
1077
+ if (useLazyInference ()) {
1078
+ // Assume that a mutating method does not depend on its parameters.
1079
+ // This is unsafe but needed because some MutableSpan APIs snuck into
1080
+ // the standard library interface without specifying dependencies.
1081
+ pushDeps (createDeps (selfIndex).add (selfIndex,
1082
+ LifetimeDependenceKind::Inherit));
1083
+ }
1077
1084
return ;
1078
1085
}
1079
1086
pushDeps (createDeps (selfIndex).add (selfIndex,
@@ -1120,6 +1127,17 @@ class LifetimeDependenceChecker {
1120
1127
.add (newValIdx, *kind));
1121
1128
break ;
1122
1129
}
1130
+ case AccessorKind::MutableAddress:
1131
+ if (useLazyInference ()) {
1132
+ // Assume that a mutating method does not depend on its parameters.
1133
+ // Currently only for backward interface compatibility. Even though this
1134
+ // is the only useful dependence (a borrow of self is possible but not
1135
+ // useful), explicit annotation is required for now to confirm that the
1136
+ // mutated self cannot depend on anything stored at this address.
1137
+ pushDeps (createDeps (selfIndex).add (selfIndex,
1138
+ LifetimeDependenceKind::Inherit));
1139
+ }
1140
+ break ;
1123
1141
default :
1124
1142
// Unknown mutating accessor.
1125
1143
break ;
You can’t perform that action at this time.
0 commit comments