Skip to content

Commit a3740ae

Browse files
committed
Disallow target specification in SIL's @Lifetime
SIL's @Lifetime continues to be positional. Don't parse 'target:' in this case.
1 parent 2711434 commit a3740ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5165,7 +5165,8 @@ ParserResult<LifetimeEntry> Parser::parseLifetimeEntry(SourceLoc loc) {
51655165
auto lParenLoc = consumeAttributeLParen(); // consume the l_paren
51665166

51675167
std::optional<LifetimeDescriptor> targetDescriptor;
5168-
if (Tok.isAny(tok::identifier, tok::integer_literal, tok::kw_self) &&
5168+
if (!isInSILMode() &&
5169+
Tok.isAny(tok::identifier, tok::integer_literal, tok::kw_self) &&
51695170
peekToken().is(tok::colon)) {
51705171
targetDescriptor = parseLifetimeDescriptor(*this);
51715172
if (!targetDescriptor) {

0 commit comments

Comments
 (0)