Skip to content

False positive for "lifetime must be declared" error in 2018 preview #51008

Closed
@alexcrichton

Description

@alexcrichton

This code:

#![feature(rust_2018_preview)]

trait A {
    
}

impl<F> A for F where F: FnOnce(&i32) {}

fn main() {}

yields:

error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
 --> src/main.rs:7:33
  |
7 | impl<F> A for F where F: FnOnce(&i32) {}
  |                                 ^ in-band lifetime definition

error: aborting due to previous error

For more information about this error, try `rustc --explain E0687`.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions