Skip to content

Commit bc25e45

Browse files
authored
Merge pull request #38879 from nkcsgexi/81719628-5.5
[5.5] ABI checker: require explicit @available attributes for new APIs
2 parents 793b492 + fb69a04 commit bc25e45

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ StringRef SDKContext::getPlatformIntroVersion(Decl *D, PlatformKind Kind) {
12511251
}
12521252
}
12531253
}
1254-
return getPlatformIntroVersion(D->getDeclContext()->getAsDecl(), Kind);
1254+
return StringRef();
12551255
}
12561256

12571257
StringRef SDKContext::getLanguageIntroVersion(Decl *D) {

stdlib/public/core/Policy.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ extension Never: Equatable, Comparable, Hashable {}
3636

3737
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
3838
extension Never: Identifiable {
39+
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
3940
public var id: Never {
4041
switch self {}
4142
}

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ cake: Accessor fixedLayoutStruct2.BecomeFixedBinaryOrder.Modify() is a new API w
5353
cake: Accessor fixedLayoutStruct2.BecomeFixedBinaryOrder.Set() is a new API without @available attribute
5454
cake: Class C0 is a new API without @available attribute
5555
cake: Class C8 is a new API without @available attribute
56+
cake: Constructor AddingNewDesignatedInit.init(_:) is a new API without @available attribute
5657
cake: Constructor C1.init(_:) is a new API without @available attribute
5758
cake: Constructor ClassWithMissingDesignatedInits.init() is a new API without @available attribute
5859
cake: Constructor SubclassWithMissingDesignatedInits.init() is a new API without @available attribute
5960
cake: Enum IceKind is now without @frozen
6061
cake: EnumElement FrozenKind.AddedCase is a new API without @available attribute
62+
cake: EnumElement FutureKind.FineToAdd is a new API without @available attribute
6163
cake: Func C1.foo1() is now not static
6264
cake: Func FinalFuncContainer.NewFinalFunc() is now with final
6365
cake: Func FinalFuncContainer.NoLongerFinalFunc() is now without final
6466
cake: Func Float.floatHigher() is a new API without @available attribute
67+
cake: Func FutureKind.==(_:_:) is a new API without @available attribute
68+
cake: Func FutureKind.hash(into:) is a new API without @available attribute
6569
cake: Func HasMutatingMethodClone.foo() has self access kind changing from Mutating to NonMutating
6670
cake: Func RequiementChanges.addedFunc() is a new API without @available attribute
6771
cake: Func S1.foo1() has self access kind changing from NonMutating to Mutating
@@ -72,6 +76,7 @@ cake: Protocol P4 is a new API without @available attribute
7276
cake: Struct C6 is now with @frozen
7377
cake: Var C1.CIIns1 changes from weak to strong
7478
cake: Var C1.CIIns2 changes from strong to weak
79+
cake: Var FutureKind.hashValue is a new API without @available attribute
7580
cake: Var RequiementChanges.addedVar is a new API without @available attribute
7681
cake: Var fixedLayoutStruct.$__lazy_storage_$_lazy_d is a new API without @available attribute
7782
cake: Var fixedLayoutStruct.c is a new API without @available attribute

test/api-digester/Outputs/cake-abi.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,10 +1217,6 @@
12171217
"moduleName": "cake",
12181218
"genericSig": "<τ_0_0 where τ_0_0 : cake.PSuper>",
12191219
"sugared_genericSig": "<Self where Self : cake.PSuper>",
1220-
"intro_Macosx": "10.15",
1221-
"intro_iOS": "13",
1222-
"intro_tvOS": "13",
1223-
"intro_watchOS": "6",
12241220
"funcSelfKind": "NonMutating"
12251221
}
12261222
],

test/api-digester/Outputs/cake.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,10 +1104,6 @@
11041104
"usr": "s:4cake6PSuperPAAE9futureFooyyF",
11051105
"moduleName": "cake",
11061106
"genericSig": "<Self where Self : cake.PSuper>",
1107-
"intro_Macosx": "10.15",
1108-
"intro_iOS": "13",
1109-
"intro_tvOS": "13",
1110-
"intro_watchOS": "6",
11111107
"funcSelfKind": "NonMutating"
11121108
}
11131109
],

0 commit comments

Comments
 (0)