Hacker News new | ask | show | jobs
by mk89 1292 days ago
> If you want to go further, you can disable unsafe in a crate by adding #[forbid(unsafe)].

Cool, so it's possible to exclude dependencies which include unsafe stuff! That's awesome.

See, this is the kind of stuff I was looking for.

From the perspective of a team writing new Rust code:

1) Don't allow unsafe (you can have an easy code search for this) 2) Forbid unsafe cargos

Finally: how do you catch unsafe in the standard library?

1 comments

> 1) Don't allow unsafe (you can have an easy code search for this) 2) Forbid unsafe cargos

This can be accomplished with cargo vet (https://mozilla.github.io/cargo-vet/how-it-works.html?highli...)