Skip to content

Commit 7818b8c

Browse files
authored
Merge pull request #84702 from atrick/builtin-nonescapable
Allow Builtin.Load/Take -> ~Escapable
2 parents 229c36e + df42301 commit 7818b8c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/swift/AST/Builtins.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ BUILTIN_SIL_OPERATION(LoadRaw, "loadRaw", Special)
240240
BUILTIN_SIL_OPERATION(LoadInvariant, "loadInvariant", Special)
241241

242242
/// Take has type (Builtin.RawPointer) -> T
243+
/// where T: ~Copyable & ~Escapable
243244
BUILTIN_SIL_OPERATION(Take, "take", Special)
244245

245246
/// Destroy has type (T.Type, Builtin.RawPointer) -> ()

lib/AST/Builtins.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,16 +923,14 @@ static ValueDecl *getRefCountingOperation(ASTContext &ctx, Identifier id) {
923923
static ValueDecl *getLoadOperation(ASTContext &ctx, Identifier id) {
924924
return getBuiltinFunction(ctx, id, _thin,
925925
_generics(_unrestricted,
926-
_conformsTo(_typeparam(0), _copyable),
927-
_conformsTo(_typeparam(0), _escapable)),
926+
_conformsTo(_typeparam(0), _copyable)),
928927
_parameters(_rawPointer),
929928
_typeparam(0));
930929
}
931930

932931
static ValueDecl *getTakeOperation(ASTContext &ctx, Identifier id) {
933932
return getBuiltinFunction(ctx, id, _thin,
934-
_generics(_unrestricted,
935-
_conformsTo(_typeparam(0), _escapable)),
933+
_generics(_unrestricted),
936934
_parameters(_rawPointer),
937935
_typeparam(0));
938936
}

0 commit comments

Comments
 (0)