Add tests

This commit is contained in:
Esteban Küber 2019-12-10 11:14:49 -08:00
parent 5d1adbb629
commit 2924d38dd9
4 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,10 @@
use std::process::{Command, Stdio};
fn main() {
let process = Command::new("wc")
.stdout(Stdio::piped())
.spawn()
.or_else(|err| { //~ ERROR type annotations needed
panic!("oh no: {:?}", err);
}).unwrap();
}

View file

@ -0,0 +1,12 @@
error[E0282]: type annotations needed
--> $DIR/or_else-multiple-type-params.rs:7:10
|
LL | .or_else(|err| {
| ^^^^^^^
| |
| cannot infer type for `F`
| help: consider specifying the type arguments in the method call: `or_else::<F, O>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.

View file

@ -0,0 +1,5 @@
fn main() {
let mut lst: [([i32; 10], bool); 10] = [([0; 10], false); 10];
lst.sort_by_key(|&(v, _)| v.iter().sum()); //~ ERROR type annotations needed
println!("{:?}", lst);
}

View file

@ -0,0 +1,11 @@
error[E0282]: type annotations needed
--> $DIR/sort_by_key.rs:3:9
|
LL | lst.sort_by_key(|&(v, _)| v.iter().sum());
| ^^^^^^^^^^^ --- help: consider specifying the type argument in the method call: `sum::<S>`
| |
| cannot infer type for `K`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.