Skip to content

Suggest appropriate syntax on missing lifetime specifier in return type #55170

Closed
@estebank

Description

@estebank

Given the following code:

extern crate futures;

use futures::Future;
use std::error::Error;

fn foo() -> impl Future<Item=(), Error=Box<Error>> {
    Ok(())
}

Suggest the appropriate syntax to add the 'static lifetime bound (Box<Error + 'static>).

CC: https://www.reddit.com/r/rust/comments/9ozzic/expected_lifetime_parameter_with_future_utilizing/

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions