Skip to content

Remove incorrect lifetime annotations on methods of Escapable types#45

Merged
DougGregor merged 2 commits intoapple:mainfrom
DougGregor:remove-incorrect-lifetime-annotations
Jan 6, 2026
Merged

Remove incorrect lifetime annotations on methods of Escapable types#45
DougGregor merged 2 commits intoapple:mainfrom
DougGregor:remove-incorrect-lifetime-annotations

Conversation

@DougGregor
Copy link
Copy Markdown
Member

@DougGregor DougGregor commented Jan 6, 2026

One cannot provide a lifetime annotation for a method of an escapable type, because they don't have lifetimes. Older compilers didn't diagnose this, but newer ones produce an error. Remove all of these incorrect lifetime annotations.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've run Scripts/format.sh to correctly format my change
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@DougGregor DougGregor force-pushed the remove-incorrect-lifetime-annotations branch from b8d7bfb to 9b78741 Compare January 6, 2026 16:59
One cannot provide a lifetime annotation for a method of an escapable
type, because they don't have lifetimes. Older compilers didn't
diagnose this, but newer ones produce an error. Remove all of these
incorrect lifetime annotations.
@DougGregor DougGregor force-pushed the remove-incorrect-lifetime-annotations branch from 9b78741 to a44e419 Compare January 6, 2026 17:17
@DougGregor DougGregor merged commit 4295f89 into apple:main Jan 6, 2026
13 checks passed
@DougGregor DougGregor deleted the remove-incorrect-lifetime-annotations branch January 6, 2026 17:31
@inlinable
#if compiler(<6.3)
@_lifetime(copy self)
#endif
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be @_lifetime(self: copy self) ? I think that works for swift 6.2+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants