Skip to content

Box<Fn(int) -> int + 'static> is not accepted: "explicit lifetime bound required" #18772

@japaric

Description

@japaric

STR

#![feature(unboxed_closures)]

#[cfg(error)]
fn adder(y: int) -> Box<Fn(int) -> int + 'static> {
    //~^ error: explicit lifetime bound required
    box move |&: x| y + x
}

#[cfg(not(error))]
fn adder(y: int) -> Box<Fn<(int,), int> + 'static> {
    box move |&: x| y + x
}

fn main() {}

Version: ebc625a (2014-11-08)

cc @nikomatsakis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions