3 ms·
Heard of `#![forbid(unsafe_code)]` ?
by jtrueb 8mo ago
Heard of `#![forbid(unsafe_code)]` ?
- jenadine 8mo ago#![deny(clippy::unwrap_used)]
- weinzierl 8mo agoI doubt unsafe would be blatantly banned. I was more thinking of things like glob imports.
- bulbar 8mo agoIt's that effectively enforcement of features that are banned?
- tialaramex 8mo agoRust's compiler has six what it calls "lint levels" two of which can't be overridden by compiler flags, these handle all of its diagnostics and are also commonly used by linters like clippy. Allow and Expect are levels where it's OK that a diagnostic happened, but with Expect if the diagnostic expected was not found then we get another diagnostic telling us that our expectation wasn't fulfilled. Warn and Force-Warn are levels where we get a warning but compilation results in an executable anyway. Force-warn is a level where you can't tell the compiler not to emit this warning. Deny and Forbid are levels where the diagnostic is reported and compilation fails, so we do not get an executable. Forbid, like Force-warn cannot be overriden with compiler flags.