On Tue, Nov 9, 2021 at 5:17 AM Viresh Kumar viresh.kumar@linaro.org wrote:
I get that now. Actually I tried to find documentation on the Safety comments and failed to find any. Is this undocumented tribal knowledge or is really suggested by Rust documentation which I missed to find ?
It is a convention used by the standard library and other libraries, and Clippy has lints for both.
For instance, see `Option::unwrap_unchecked` which has both cases: https://doc.rust-lang.org/src/core/option.rs.html#780
Note that you can still find places without the `SAFETY` comment in the standard library, though.
Cheers, Miguel