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
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Rust,
- Rust: Cargo Init vs Cargo New Command
- Rust: Write and Run Hello World! Program Example
- How to Split a String using Rust Language
- How to Sort a Vector in Rust with Examples
- Fix: error: could not find `Cargo.toml` in Users or any parent directory
- How to uninstall Rust Language from Mac/Linux/Ubuntu
- How to update Cargo (Rust Lang)
- Fix: rust-analyzer failed to discover workspace [Visual Studio Code]
- How to install Rust using rustup on macOS/Linux/Ubuntu
- Cargo Watch: To Recompile Rust Project Automatically
- Difference between rustc and cargo build commands
- How to Split a String by Space in Rust
- How to know Rust is Installed on Mac?
- Rust: zsh: no such file or directory: ./main
- How to update Rust on Mac/Linux
- List of Rust Cargo Commands
- How to find version of Cargo in Rust
- Fix: error: mismatched closing delimiter } [Rust]
More Posts:
- Install Visual Studio VS Code on Mac using Brew - MacOS
- How to Open PowerShell on Mac? - Powershell
- How to uninstall Visual Studio Code on macOS - MacOS
- How to turn off Dark Mode in Excel App for Mac - Windows
- How to create a Symbolic Link in Linux (ln -s) - Linux
- JSON Nest Objects Example: JSON Tutorial - Json-Tutorial
- Building library Gradle Project Info: Downloading services.gradle.org - Android-Studio
- How to print an exception in Python - Python