Created
February 16, 2018 01:59
-
-
Save func-hs/c08a87dab7c326fea321589ecb7b0737 to your computer and use it in GitHub Desktop.
マクロの引数を間違えた場合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rustc test.rs | |
error[E0308]: mismatched types | |
--> test.rs:2:35 | |
| | |
2 | let r: Result<(), &str> = Err(format!("hello!")); | |
| ^^^^^^^^^^^^^^^^^ | |
| | | |
| expected &str, found struct `std::string::String` | |
| help: consider borrowing here: `&format!("hello!")` | |
| | |
= note: expected type `&str` | |
found type `std::string::String` | |
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let r: Result<(), &str> = Err(format!("hello!")); | |
println!("{:?}", r); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment