fn main() {
println!("Hello, world!";
}
If you try to do a cargo build for the above code, you will get a mismatched closing delimiter error.
% cargo build
Compiling myproj1 v0.1.0 (/Users/c2ctechtv/Desktop/myproj1)
error: mismatched closing delimiter: `}`
--> src/main.rs:2:13
|
1 | fn main() {
| - closing delimiter possibly meant for this
2 | println!("Hello, world!";
| ^ unclosed delimiter
3 | }
| ^ mismatched closing delimiter
error: could not compile `myproj1` (bin "myproj1") due to previous error
You may wonder that the error says missing "curly brace }" but it is actually the closing brace ) at line 2.

After adding it the build goes well!
% cargo build
Compiling myproj1 v0.1.0 (/Users/c2ctech/Desktop/myproj1)
Finished dev [unoptimized + debuginfo] target(s) in 0.66s
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!