Holochain Forum

Hc test from hdk = "=0.0.42-alpha1": futures-io: error[E0106]: missing lifetime specifier

I’m excited to get deep into development but have been running into several baffling issues. I understand that the ecosystem is moving fast so it seems prudent to be up to date with the latest development versions. In an attempt to fix https://github.com/holochain/holochain-rust/issues/2028,
I updated to the latest version of hdk. Here is my zome’s Cargo.toml

[package]
name = "cogov"
version = "0.1.0"
authors = ["hc-scaffold-framework"]
edition = "2018"

[dependencies]
futures-io = "=0.3.1"
hdk = "=0.0.42-alpha1"
hdk_proc_macros = "=0.0.42-alpha1"
holochain_json_derive = "=0.0.17"
holochain_persistence_api = "=0.0.11"
holochain_wasm_utils = "=0.0.42-alpha1"
log = "0.4"
serde = "=1.0.89"
serde_json = { version = "=1.0.39", features = ["preserve_order"] }
serde_derive = "=1.0.89"

[lib]
path = "src/lib.rs"
crate-type = ["cdylib"]

When I run hc test I have the following output. Note that I created an issue with futures-io https://github.com/rust-lang/futures-rs/issues/2019

% nix-shell --run "hc test" https://holochain.love                                   :(
Packaging files for testing to file: "/home/brian/work/cogov/cogov-dev/dist/cogov-dev.dna.json"
> cargo build --release --target=wasm32-unknown-unknown
   Compiling futures-io v0.3.1
   Compiling proc-macro-hack v0.5.11
error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:291:28
    |
291 |             -> Poll<Result<&[u8]>>;
    |                            ^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 2's 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:507:32
    |
507 |                 -> Poll<Result<&[u8]>>
    |                                ^ expected lifetime parameter
...
519 |         deref_async_buf_read!();
    |         ------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:507:32
    |
507 |                 -> Poll<Result<&[u8]>>
    |                                ^ expected lifetime parameter
...
523 |         deref_async_buf_read!();
    |         ------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:532:28
    |
532 |             -> Poll<Result<&[u8]>>
    |                            ^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:545:32
    |
545 |                 -> Poll<Result<&[u8]>>
    |                                ^ expected lifetime parameter
...
557 |         delegate_async_buf_read_to_stdio!();
    |         ------------------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 2's 2 lifetimes it is borrowed from

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0106`.
error: Could not compile `futures-io`.
warning: build failed, waiting for other jobs to finish...
error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:291:28
    |
291 |             -> Poll<Result<&[u8]>>;
    |                            ^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 2's 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:507:32
    |
504 | /     macro_rules! deref_async_buf_read {
505 | |         () => {
506 | |             fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>)
507 | |                 -> Poll<Result<&[u8]>>
    | |                                ^ expected lifetime parameter
...   |
515 | |         }
516 | |     }
    | |_____- in this expansion of `deref_async_buf_read!`
...
519 |           deref_async_buf_read!();
    |           ------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:507:32
    |
504 | /     macro_rules! deref_async_buf_read {
505 | |         () => {
506 | |             fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>)
507 | |                 -> Poll<Result<&[u8]>>
    | |                                ^ expected lifetime parameter
...   |
515 | |         }
516 | |     }
    | |_____- in this expansion of `deref_async_buf_read!`
...
523 |           deref_async_buf_read!();
    |           ------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:532:28
    |
532 |             -> Poll<Result<&[u8]>>
    |                            ^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `cx`'s 2 lifetimes it is borrowed from

error[E0106]: missing lifetime specifier
   --> /home/brian/work/cogov/cogov-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.1/src/lib.rs:545:32
    |
542 | /     macro_rules! delegate_async_buf_read_to_stdio {
543 | |         () => {
544 | |             fn poll_fill_buf(self: Pin<&mut Self>, _: &mut Context<'_>)
545 | |                 -> Poll<Result<&[u8]>>
    | |                                ^ expected lifetime parameter
...   |
553 | |         }
554 | |     }
    | |_____- in this expansion of `delegate_async_buf_read_to_stdio!`
...
557 |           delegate_async_buf_read_to_stdio!();
    |           ------------------------------------ in this macro invocation
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 2's 2 lifetimes it is borrowed from

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0106`.
error: Could not compile `futures-io`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Couldn't traverse DNA in directory "/home/brian/work/cogov/cogov-dev": command cargo build --release --target=wasm32-unknown-unknown was not successful
nix-shell --run "hc test" https://holochain.love  8.53s user 0.54s system 136% cpu 6.626 total

Are you running the application from within nix-shell?
I think this is probably an issue of using the wrong version of rustc.

Yes, I’m running:

nix-shell --run "hc test" https://holochain.love

Same with hc-package in the nix-shell.

% nix-shell --run "rustc -V" https://holochain.love
rustc 1.38.0-nightly (69656fa4c 2019-07-13)

Hmm that is the correct version.
Hey maybe try just entering the nix-shell and then running the commands:

nix-shell https://holochain.love
hc test

And see if that works?

Same issue. I also tried removing the .cargo directories.

It looks like it’s an upstream issue with futures-io

Actually I just realized the template has gotten ahead of the .love
Can you try entering the nix-shell like:

nix-shell https://github.com/holochain/holonix/archive/v0.0.60.tar.gz
1 Like

@freesig It looks like the install issue is fixed. I’m getting another error, but I’ll post it in another thread.

Thank you!

It looks like the minimum rust version necessary for futures-io is 1.39.0

@freesig Would it be possible to update holochain.love to the latest version of rust?

Yep this should be happening today :slight_smile:

1 Like