File tree 2 files changed +106
-149
lines changed
2 files changed +106
-149
lines changed Original file line number Diff line number Diff line change @@ -992,6 +992,13 @@ class LifetimeDependenceChecker {
992
992
return ;
993
993
}
994
994
if (afd->getParameters ()->size () > 0 ) {
995
+ if (useLazyInference ()) {
996
+ // Assume that a mutating method does not depend on its parameters.
997
+ // This is unsafe but needed because some MutableSpan APIs snuck into
998
+ // the standard library interface without specifying dependencies.
999
+ pushDeps (createDeps (selfIndex).add (selfIndex,
1000
+ LifetimeDependenceKind::Inherit));
1001
+ }
995
1002
return ;
996
1003
}
997
1004
pushDeps (createDeps (selfIndex).add (selfIndex,
@@ -1037,6 +1044,17 @@ class LifetimeDependenceChecker {
1037
1044
.add (newValIdx, kind));
1038
1045
break ;
1039
1046
}
1047
+ case AccessorKind::MutableAddress:
1048
+ if (useLazyInference ()) {
1049
+ // Assume that a mutating method does not depend on its parameters.
1050
+ // Currently only for backward interface compatibility. Even though this
1051
+ // is the only useful dependence (a borrow of self is possible but not
1052
+ // useful), explicit annotation is required for now to confirm that the
1053
+ // mutated self cannot depend on anything stored at this address.
1054
+ pushDeps (createDeps (selfIndex).add (selfIndex,
1055
+ LifetimeDependenceKind::Inherit));
1056
+ }
1057
+ break ;
1040
1058
default :
1041
1059
// Unknown mutating accessor.
1042
1060
break ;
You can’t perform that action at this time.
0 commit comments