Skip to content

Commit 69abe44

Browse files
Add tests
1 parent 81cde69 commit 69abe44

4 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
a((), 1i32 == 2u32);
3+
//~^ ERROR cannot find function `a` in this scope
4+
//~| ERROR mismatched types
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/check-args-on-fn-err-2.rs:2:19
3+
|
4+
LL | a((), 1i32 == 2u32);
5+
| ---- ^^^^ expected `i32`, found `u32`
6+
| |
7+
| expected because this is `i32`
8+
|
9+
help: change the type of the numeric literal from `u32` to `i32`
10+
|
11+
LL | a((), 1i32 == 2i32);
12+
| ~~~
13+
14+
error[E0425]: cannot find function `a` in this scope
15+
--> $DIR/check-args-on-fn-err-2.rs:2:5
16+
|
17+
LL | a((), 1i32 == 2u32);
18+
| ^ not found in this scope
19+
20+
error: aborting due to 2 previous errors
21+
22+
Some errors have detailed explanations: E0308, E0425.
23+
For more information about an error, try `rustc --explain E0308`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
unknown(1, |glyf| {
3+
//~^ ERROR: cannot find function `unknown` in this scope
4+
let actual = glyf;
5+
});
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find function `unknown` in this scope
2+
--> $DIR/check-args-on-fn-err.rs:2:5
3+
|
4+
LL | unknown(1, |glyf| {
5+
| ^^^^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.

0 commit comments

Comments
 (0)