mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
18 lines
606 B
Plaintext
18 lines
606 B
Plaintext
$ cargo run
|
|
Compiling closure-example v0.1.0 (file:///projects/closure-example)
|
|
error[E0308]: mismatched types
|
|
--> src/main.rs:5:29
|
|
|
|
|
5 | let n = example_closure(5);
|
|
| ^
|
|
| |
|
|
| expected struct `String`, found integer
|
|
| help: try using a conversion method: `5.to_string()`
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|
|
error: could not compile `closure-example`
|
|
|
|
To learn more, run the command again with --verbose.
|