Skip to content

Update to latest lifetimes syntax #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged

Conversation

natecook1000
Copy link
Member

Moves from @lifetime to @_lifetime and the LifetimeDependence experimental feature to Lifetimes, eliminating a bunch of warnings in the latest compiler.

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 read the Contribution Guidelines
  • I've updated the documentation if necessary

Moves from `@lifetime` to `@_lifetime` and the `LifetimeDependence`
experimental feature to `Lifetimes`.
@natecook1000 natecook1000 merged commit 94d3aeb into main Aug 13, 2025
16 checks passed
@natecook1000 natecook1000 deleted the underscore-at-lifetime branch August 13, 2025 15:01
@finagolfin
Copy link

I just tried to build the latest trunk from this repo on linux using the latest official Aug. 11 trunk 6.3 snapshot toolchain and saw a bunch of these lifetime errors:

/home/finagolfin/swift-binary-parsing/Sources/BinaryParsing/Parsers/Integer.swift:786:4: error: invalid lifetime dependence on an Escapable result
784 |
785 |   @inlinable
786 |   @_lifetime(&input)
    |    `- error: invalid lifetime dependence on an Escapable result                              
787 |   public init<T: SingleByteInteger>(                                                         
788 |     parsing input: inout ParserSpan,

I was confused, as you have a linux nightly CI, but I then found you are only testing 6.2, not the trunk 6.3 branch of the toolchain. Should we be avoiding 6.3 to build this repo?

@natecook1000
Copy link
Member Author

Huh. I haven't tried the 6.3 snapshots yet, so can't say if there's a way to satisfy both given that error. This project targeting 6.2 right now, but I'll take a look at what 6.3 support requires 👍🏻

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