Skip to content

regression: parameter may not live long enough #152348

@Mark-Simulacrum

Description

@Mark-Simulacrum
[INFO] [stdout] error[E0310]: the parameter type `T` may not live long enough
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/cogo-0.1.2/src/yield_now.rs:35:13
[INFO] [stdout]    |
[INFO] [stdout] 35 |     let r = resource as &dyn EventSource as *const _ as *mut _;
[INFO] [stdout]    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]    |             |
[INFO] [stdout]    |             the parameter type `T` must be valid for the static lifetime...
[INFO] [stdout]    |             ...so that the type `T` will meet its required lifetime bounds
[INFO] [stdout]    |
[INFO] [stdout] help: consider adding an explicit lifetime bound
[INFO] [stdout]    |
[INFO] [stdout] 21 | pub fn yield_with<T: EventSource + 'static>(resource: &T) {
[INFO] [stdout]    |                                  +++++++++

I think this is all #136776, so closing as expected breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions