Skip to content
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

Fix compiler errors about lifetime #83

Commits on Aug 2, 2023

  1. Fix compiler errors about lifetime

    With
    ```
    rustc --version
    rustc 1.68.2 (9eb3afe9e 2023-03-27)
    cargo --version
    cargo 1.68.2 (6feb7c9cf 2023-03-26)
    ```
    I was getting the following errors:
    ```
       Compiling rs-matter v0.1.0 (/Users/markusbecker/src/matter-rs/rs-matter)
    error[E0310]: the parameter type `D` may not live long enough
       --> rs-matter/src/mdns/builtin.rs:131:5
        |
    131 | /     {
    132 | |         let mut udp = crate::transport::udp::UdpListener::new(
    133 | |             stack,
    134 | |             crate::transport::network::SocketAddr::new(IpAddr::V6(Ipv6Addr::UNSPECIFIED), PORT),
    ...   |
    201 | |             .unwrap()
    202 | |     }
        | |_____^ ...so that the type `D` will meet its required lifetime bounds
        |
    help: consider adding an explicit lifetime bound...
        |
    130 |         D: crate::transport::network::NetworkStackDriver + 'static,
        |                                                          +++++++++
    
    error[E0310]: the parameter type `D` may not live long enough
       --> rs-matter/src/transport/core.rs:134:5
        |
    134 | /     {
    135 | |         let udp = crate::transport::udp::UdpListener::new(
    136 | |             stack,
    137 | |             crate::transport::network::SocketAddr::new(
    ...   |
    200 | |             .unwrap()
    201 | |     }
        | |_____^ ...so that the type `D` will meet its required lifetime bounds
        |
    help: consider adding an explicit lifetime bound...
        |
    132 |         D: crate::transport::network::NetworkStackDriver + 'static,
        |                                                          +++++++++
    
    For more information about this error, try `rustc --explain E0310`.
    ```
    
    This commit applies those recommendations.
    markus-becker-tridonic-com committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    8edec2b View commit details
    Browse the repository at this point in the history