From fbc6b26592381d3916cf59639af99a3b3645ea8e Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Thu, 11 May 2017 12:06:12 +0100 Subject: [PATCH] clean tests/ui/eta.rs Cleaning the empty lines for clarity. --- tests/ui/eta.rs | 15 --------------- tests/ui/eta.stderr | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/tests/ui/eta.rs b/tests/ui/eta.rs index d333b938a32..91e081f5ec6 100644 --- a/tests/ui/eta.rs +++ b/tests/ui/eta.rs @@ -5,20 +5,10 @@ fn main() { let a = Some(1u8).map(|a| foo(a)); - - - meta(|a| foo(a)); - - - let c = Some(1u8).map(|a| {1+2; foo}(a)); - - - let d = Some(1u8).map(|a| foo((|b| foo2(b))(a))); //is adjusted? all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted - unsafe { Some(1u8).map(|a| unsafe_fn(a)); // unsafe fn } @@ -26,11 +16,7 @@ fn main() { // See #815 let e = Some(1u8).map(|a| divergent(a)); let e = Some(1u8).map(|a| generic(a)); - - - let e = Some(1u8).map(generic); - // See #515 let a: Option>> = Some(vec![1i32, 2]).map(|v| -> Box<::std::ops::Deref> { Box::new(v) }); @@ -41,7 +27,6 @@ fn meta(f: F) where F: Fn(u8) { } fn foo(_: u8) { - } fn foo2(_: u8) -> u8 { diff --git a/tests/ui/eta.stderr b/tests/ui/eta.stderr index 355db4deae4..b218523ba5f 100644 --- a/tests/ui/eta.stderr +++ b/tests/ui/eta.stderr @@ -11,29 +11,29 @@ note: lint level defined here | ^^^^^^^^^^^^^^^^^ error: redundant closure found - --> $DIR/eta.rs:11:10 - | -11 | meta(|a| foo(a)); - | ^^^^^^^^^^ help: remove closure as shown: `foo` + --> $DIR/eta.rs:8:10 + | +8 | meta(|a| foo(a)); + | ^^^^^^^^^^ help: remove closure as shown: `foo` error: redundant closure found - --> $DIR/eta.rs:15:27 - | -15 | let c = Some(1u8).map(|a| {1+2; foo}(a)); - | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}` + --> $DIR/eta.rs:9:27 + | +9 | let c = Some(1u8).map(|a| {1+2; foo}(a)); + | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}` warning: this expression borrows a reference that is immediately dereferenced by the compiler - --> $DIR/eta.rs:20:21 + --> $DIR/eta.rs:11:21 | -20 | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted +11 | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted | ^^^ | = note: #[warn(needless_borrow)] on by default error: redundant closure found - --> $DIR/eta.rs:28:27 + --> $DIR/eta.rs:18:27 | -28 | let e = Some(1u8).map(|a| generic(a)); +18 | let e = Some(1u8).map(|a| generic(a)); | ^^^^^^^^^^^^^^ help: remove closure as shown: `generic` error: aborting due to 4 previous errors