When I compile a program using rustc
I usually get errors. Once I've eliminated the errors, I get no message which means that compile was successful.
Is there an option to get rustc
to show a "successful" message? It would be nice to see positive feedback.
Most Rust programmers don't invoke rustc
directly, but instead do it through cargo
, which prints a green success message for each crate that is compiled:
$ cargo build
Compiling cfg-if v0.1.10
Compiling lazy_static v1.4.0
Compiling bytes v0.5.6
Compiling mycrate v0.2.0 (/dev/rust/mycrate)
Finished dev [unoptimized + debuginfo] target(s) in 13.17s
You will also get a progress bar tracking the build process:
$ cargo build
Compiling cfg-if v0.1.10
Compiling lazy_static v1.4.0
Building [====================> ] 3/4: bytes
rustc
is more bare-bones and does not output any success messages. However, you can use &&
to print a message manually if the compilation was successful:
$ rustc main.rs && echo "Compiled successfully"
Compiled successfully
If you want to get even more fancy, you can use ASCII escape codes to make the message green!
$ rustc main.rs && echo "\033[0;32mCompiled successfully"
Compiled successfully # <- this is green!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With