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

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

Closed
japaric opened this issue Nov 8, 2014 · 2 comments

Comments

@japaric
Copy link
Member

japaric commented Nov 8, 2014

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

@aturon aturon mentioned this issue Nov 10, 2014
47 tasks
@nikomatsakis
Copy link
Contributor

Added to metabug, will take a look.

@nikomatsakis
Copy link
Contributor

This is due to the precedence of +. It is fixed by #19298.

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants