Used manifest key: profile.panic


In Chapter 9.1 of the book, it says:

If you’re in a situation where you need to make the resulting binary as small as possible, you can switch from unwinding on panic to aborting on panic by adding panic = ‘abort’ to the appropriate [profile] sections in your Cargo.toml.

When I add that to my Cargo.toml, and run cargo build, I get:
warning: unused manifest key: profile.panic
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs


You need to specify the specific profile you’re talking about:

panic = "abort"


That did it, no more error message. It didn’t reduce the size of the binary by much , but it was on a small toy program.