Skip to content

Tokio-tls compile error #1546

@Drevoed

Description

@Drevoed

Version

cargo tree | grep tokio                                                                   ░▒▓ at 13:18:40 
│   │   ├── tokio-codec v0.2.0-alpha.4
│   │   │   └── tokio-io v0.2.0-alpha.4
│   │   ├── tokio-io v0.2.0-alpha.4 (*)
│   │   └── tokio-sync v0.2.0-alpha.4
│   ├── tokio v0.2.0-alpha.4
│   │   ├── tokio-codec v0.2.0-alpha.4 (*)
│   │   ├── tokio-executor v0.2.0-alpha.4
│   │   │   ├── tokio-sync v0.2.0-alpha.4 (*)
│   │   ├── tokio-fs v0.2.0-alpha.4
│   │   │   ├── tokio-executor v0.2.0-alpha.4 (*)
│   │   │   ├── tokio-io v0.2.0-alpha.4 (*)
│   │   │   └── tokio-sync v0.2.0-alpha.4 (*)
│   │   ├── tokio-io v0.2.0-alpha.4 (*)
│   │   ├── tokio-macros v0.2.0-alpha.4
│   │   ├── tokio-net v0.2.0-alpha.4
│   │   │   ├── tokio-codec v0.2.0-alpha.4 (*)
│   │   │   ├── tokio-executor v0.2.0-alpha.4 (*)
│   │   │   ├── tokio-io v0.2.0-alpha.4 (*)
│   │   │   ├── tokio-sync v0.2.0-alpha.4 (*)
│   │   ├── tokio-sync v0.2.0-alpha.4 (*)
│   │   ├── tokio-timer v0.3.0-alpha.4
│   │   │   ├── tokio-executor v0.2.0-alpha.4 (*)
│   │   │   └── tokio-sync v0.2.0-alpha.4 (*)
│   ├── tokio-executor v0.2.0-alpha.4 (*)
│   ├── tokio-io v0.2.0-alpha.4 (*)
│   ├── tokio-net v0.2.0-alpha.4 (*)
│   ├── tokio-sync v0.2.0-alpha.4 (*)
│   ├── tokio-timer v0.3.0-alpha.4 (*)
│   │   ├── tokio-io v0.2.0-alpha.4 (*)
│   └── tokio v0.2.0-alpha.4 (*)
│   ├── tokio-io v0.2.0-alpha.4 (*)
│   └── tokio-tls v0.3.0-alpha.4
│       └── tokio-io v0.2.0-alpha.4 (*)
└── tokio v0.2.0-alpha.4 (*)

Platform

Linux arkrait 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux

Subcrates

tokio-tls

Description

When trying to compile tokio-tls with latest nightly (2019-09-10) compiler fails with

error[E0597]: `self` does not live long enough
   --> /home/miron/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tls-0.3.0-alpha.4/src/lib.rs:305:23
    |
305 |         handshake(|s| self.0.accept(s), stream).await
    |         --------------^^^^---------------------
    |         |         |   |
    |         |         |   borrowed value does not live long enough
    |         |         value captured here
    |         a temporary with access to the borrow is created here ...
306 |     }
    |     -
    |     |
    |     `self` dropped here while still borrowed
    |     ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `impl std::future::Future`
    |
    = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions