Skip to content

Commit 2924d38

Browse files
committed
Add tests
1 parent 5d1adbb commit 2924d38

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use std::process::{Command, Stdio};
2+
3+
fn main() {
4+
let process = Command::new("wc")
5+
.stdout(Stdio::piped())
6+
.spawn()
7+
.or_else(|err| { //~ ERROR type annotations needed
8+
panic!("oh no: {:?}", err);
9+
}).unwrap();
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/or_else-multiple-type-params.rs:7:10
3+
|
4+
LL | .or_else(|err| {
5+
| ^^^^^^^
6+
| |
7+
| cannot infer type for `F`
8+
| help: consider specifying the type arguments in the method call: `or_else::<F, O>`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0282`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let mut lst: [([i32; 10], bool); 10] = [([0; 10], false); 10];
3+
lst.sort_by_key(|&(v, _)| v.iter().sum()); //~ ERROR type annotations needed
4+
println!("{:?}", lst);
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/sort_by_key.rs:3:9
3+
|
4+
LL | lst.sort_by_key(|&(v, _)| v.iter().sum());
5+
| ^^^^^^^^^^^ --- help: consider specifying the type argument in the method call: `sum::<S>`
6+
| |
7+
| cannot infer type for `K`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)