Skip to content

Commit c37e6dd

Browse files
projediGrzegorz
authored and
Grzegorz
committed
Workaround for rust-lang/rustfmt#3615
1 parent 7539bfc commit c37e6dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/ui/eta.fixed

+4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ fn test_redundant_closure_with_another_closure() {
178178
let a = Some(1u8).map(closure);
179179
}
180180

181+
<<<<<<< HEAD
181182
<<<<<<< HEAD
182183
fn call<F: FnOnce(&mut String) -> String>(f: F) -> String {
183184
f(&mut "Hello".to_owned())
@@ -198,6 +199,9 @@ fn test_deref_with_trait_method() {
198199
let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();;
199200
=======
200201
fn make_lazy(f: fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
202+
=======
203+
fn make_lazy(f: impl Fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
204+
>>>>>>> Workaround for rust-lang/rustfmt#3615
201205
// Currently f is called when result of make_lazy is called.
202206
// If the closure is removed, f will be called when make_lazy itself is
203207
// called. This changes semantics, so the closure must stay.

tests/ui/eta.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ fn test_redundant_closure_with_another_closure() {
178178
let a = Some(1u8).map(|a| closure(a));
179179
}
180180

181-
<<<<<<< HEAD
182181
fn call<F: FnOnce(&mut String) -> String>(f: F) -> String {
183182
f(&mut "Hello".to_owned())
184183
}
@@ -196,7 +195,8 @@ impl std::ops::Deref for Bar {
196195

197196
fn test_deref_with_trait_method() {
198197
let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();;
199-
fn make_lazy(f: fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
198+
199+
fn make_lazy(f: impl Fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
200200
// Currently f is called when result of make_lazy is called.
201201
// If the closure is removed, f will be called when make_lazy itself is
202202
// called. This changes semantics, so the closure must stay.

0 commit comments

Comments
 (0)