2019-12-31 18:01:45 +09:00
|
|
|
/// Test for https://github.com/rust-lang/rust-clippy/issues/2862
|
2019-02-06 07:45:57 +01:00
|
|
|
|
2018-06-21 14:43:13 +02:00
|
|
|
pub trait FooMap {
|
|
|
|
fn map<B, F: Fn() -> B>(&self, f: F) -> B;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl FooMap for bool {
|
|
|
|
fn map<B, F: Fn() -> B>(&self, f: F) -> B {
|
|
|
|
f()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = true;
|
|
|
|
a.map(|| false);
|
|
|
|
}
|