Skip to content

Commit a0b21d5

Browse files
committed
LifetimeDependence: broaden assert: allow trivial borrows.
During SIL parsing, allow `@``lifetime(borrow <argNum>)` on trivial arguments.
1 parent c05044c commit a0b21d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/AST/LifetimeDependence.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ std::optional<LifetimeDependenceInfo> LifetimeDependenceInfo::fromDependsOn(
433433
auto kind = descriptor.getParsedLifetimeDependenceKind();
434434

435435
if (kind == ParsedLifetimeDependenceKind::Scope &&
436-
(!isGuaranteedParameterInCallee(paramConvention) &&
437-
!isMutatingParameter(paramConvention))) {
436+
isConsumedParameterInCallee(paramConvention)) {
438437
diags.diagnose(loc, diag::lifetime_dependence_cannot_use_kind, "_scope",
439438
getStringForParameterConvention(paramConvention));
440439
return true;

0 commit comments

Comments
 (0)