Skip to content

regression: parameter type may not live long enough #121603

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum
[INFO] [stdout] error[E0309]: the parameter type `G` may not live long enough
[INFO] [stdout]    --> src/adapters/intersperse.rs:135:17
[INFO] [stdout]     |
[INFO] [stdout] 125 | impl<'this, L, G> Lender for IntersperseWith<'this, L, G>
[INFO] [stdout]     |      ----- the parameter type `G` must be valid for the lifetime `'this` as defined here...
[INFO] [stdout] ...
[INFO] [stdout] 135 |                 core::mem::transmute::<<Self as Lending<'this>>::Lend, <Self as Lending<'_>>::Lend>((self.separator)())
[INFO] [stdout]     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `G` will meet its required lifetime bounds
[INFO] [stdout]     |
[INFO] [stdout] help: consider adding an explicit lifetime bound
[INFO] [stdout]     |
[INFO] [stdout] 128 |     G: FnMut() -> <L as Lending<'this>>::Lend + 'this,
[INFO] [stdout]     |                                               +++++++
[INFO] [stdout] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions