Move cfail tests to ui

This commit is contained in:
Esteban Küber 2017-04-25 17:17:12 -07:00
parent b52c8c2fcf
commit b10e2933d9
8 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,24 @@
error[E0281]: type mismatch: `[closure@$DIR/E0281.rs:14:9: 14:24]` implements the trait `std::ops::Fn<(std::string::String,)>`, but the trait `std::ops::Fn<(usize,)>` is required
--> $DIR/E0281.rs:14:5
|
14 | foo(|y: String| { });
| ^^^ --------------- implements `std::ops::Fn<(std::string::String,)>`
| |
| requires `std::ops::Fn<(usize,)>`
| expected usize, found struct `std::string::String`
|
= note: required by `foo`
error[E0281]: type mismatch: `[closure@$DIR/E0281.rs:14:9: 14:24]` implements the trait `std::ops::FnOnce<(std::string::String,)>`, but the trait `std::ops::FnOnce<(usize,)>` is required
--> $DIR/E0281.rs:14:5
|
14 | foo(|y: String| { });
| ^^^ --------------- implements `std::ops::FnOnce<(std::string::String,)>`
| |
| requires `std::ops::FnOnce<(usize,)>`
| expected usize, found struct `std::string::String`
|
= note: required by `foo`
error: aborting due to 2 previous errors

View File

@ -0,0 +1,18 @@
error[E0281]: type mismatch: `fn(&mut isize) {takes_mut}` implements the trait `for<'r> std::ops::FnOnce<(&'r mut isize,)>`, but the trait `std::ops::FnOnce<(&{integer},)>` is required
--> $DIR/fn-variance-1.rs:21:5
|
21 | apply(&3, takes_mut);
| ^^^^^ types differ in mutability
|
= note: required by `apply`
error[E0281]: type mismatch: `fn(&isize) {takes_imm}` implements the trait `for<'r> std::ops::FnOnce<(&'r isize,)>`, but the trait `std::ops::FnOnce<(&mut {integer},)>` is required
--> $DIR/fn-variance-1.rs:27:5
|
27 | apply(&mut 3, takes_imm);
| ^^^^^ types differ in mutability
|
= note: required by `apply`
error: aborting due to 2 previous errors

View File

@ -0,0 +1,28 @@
error: no method named `count` found for type `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:17:39: 17:53]>` in the current scope
--> $DIR/issue-36053-2.rs:17:55
|
17 | once::<&str>("str").fuse().filter(|a: &str| true).count();
| ^^^^^
|
= note: the method `count` exists but the following trait bounds were not satisfied: `[closure@$DIR/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`, `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator`
error[E0281]: type mismatch: `[closure@$DIR/issue-36053-2.rs:17:39: 17:53]` implements the trait `for<'r> std::ops::FnMut<(&'r str,)>`, but the trait `for<'r> std::ops::FnMut<(&'r &str,)>` is required
--> $DIR/issue-36053-2.rs:17:32
|
17 | once::<&str>("str").fuse().filter(|a: &str| true).count();
| ^^^^^^ -------------- implements `for<'r> std::ops::FnMut<(&'r str,)>`
| |
| requires `for<'r> std::ops::FnMut<(&'r &str,)>`
| expected &str, found str
error[E0281]: type mismatch: `[closure@$DIR/issue-36053-2.rs:17:39: 17:53]` implements the trait `for<'r> std::ops::FnOnce<(&'r str,)>`, but the trait `for<'r> std::ops::FnOnce<(&'r &str,)>` is required
--> $DIR/issue-36053-2.rs:17:32
|
17 | once::<&str>("str").fuse().filter(|a: &str| true).count();
| ^^^^^^ -------------- implements `for<'r> std::ops::FnOnce<(&'r str,)>`
| |
| requires `for<'r> std::ops::FnOnce<(&'r &str,)>`
| expected &str, found str
error: aborting due to 3 previous errors

View File

@ -0,0 +1,30 @@
error[E0281]: type mismatch: `[closure@$DIR/unboxed-closures-vtable-mismatch.rs:22:23: 22:73]` implements the trait `std::ops::FnMut<(usize, isize)>`, but the trait `std::ops::FnMut<(isize, isize)>` is required
--> $DIR/unboxed-closures-vtable-mismatch.rs:25:13
|
22 | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
| -------------------------------------------------- implements `std::ops::FnMut<(usize, isize)>`
...
25 | let z = call_it(3, f);
| ^^^^^^^
| |
| requires `std::ops::FnMut<(isize, isize)>`
| expected isize, found usize
|
= note: required by `call_it`
error[E0281]: type mismatch: `[closure@$DIR/unboxed-closures-vtable-mismatch.rs:22:23: 22:73]` implements the trait `std::ops::FnOnce<(usize, isize)>`, but the trait `std::ops::FnOnce<(isize, isize)>` is required
--> $DIR/unboxed-closures-vtable-mismatch.rs:25:13
|
22 | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
| -------------------------------------------------- implements `std::ops::FnOnce<(usize, isize)>`
...
25 | let z = call_it(3, f);
| ^^^^^^^
| |
| requires `std::ops::FnOnce<(isize, isize)>`
| expected isize, found usize
|
= note: required by `call_it`
error: aborting due to 2 previous errors