Skip to content

Commit efd1965

Browse files
committed
Revert "Don't open existentials for library builtin shims"
This reverts commit 5b0d1fd.
1 parent 1cea2f5 commit efd1965

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,18 +1421,6 @@ namespace {
14211421
OptionSet<OpenedExistentialAdjustmentFlags>;
14221422
}
14231423

1424-
/// Determine if this function is part of the _isUnique family of functions in
1425-
/// the standard library.
1426-
static bool isStdlibUniqueFunction(ValueDecl *callee) {
1427-
if (!callee->isStdlibDecl())
1428-
return false;
1429-
1430-
auto baseName = callee->getName().getBaseName().userFacingName();
1431-
return baseName == "_isUnique" || baseName == "_isUnique_native" ||
1432-
baseName == "_COWBufferForReading" ||
1433-
baseName == "_unsafeDowncastToAnyObject";
1434-
}
1435-
14361424
/// Determine whether we should open up the existential argument to the
14371425
/// given parameters.
14381426
///
@@ -1469,14 +1457,6 @@ shouldOpenExistentialCallArgument(
14691457
return None;
14701458

14711459
case DeclTypeCheckingSemantics::Normal:
1472-
// _isUnique and friends are special because opening an existential when
1473-
// calling them would make them non-unique.
1474-
// FIXME: Borrowing properly from the existential box would probably
1475-
// eliminate this.
1476-
if (isStdlibUniqueFunction(callee))
1477-
return None;
1478-
break;
1479-
14801460
case DeclTypeCheckingSemantics::WithoutActuallyEscaping:
14811461
break;
14821462
}

0 commit comments

Comments
 (0)