clean tests/ui/eta.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 12:06:12 +01:00
parent 8fc00c57b6
commit fbc6b26592
2 changed files with 12 additions and 27 deletions

View File

@ -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<Box<::std::ops::Deref<Target = [i32]>>> =
Some(vec![1i32, 2]).map(|v| -> Box<::std::ops::Deref<Target = [i32]>> { Box::new(v) });
@ -41,7 +27,6 @@ fn meta<F>(f: F) where F: Fn(u8) {
}
fn foo(_: u8) {
}
fn foo2(_: u8) -> u8 {

View File

@ -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