Used manifest key: profile.panic


#1

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


#2

You need to specify the specific profile you’re talking about: http://doc.crates.io/manifest.html#the-profile-sections

[profile.release]
panic = "abort"

#3

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.

Thanks!