Flux is a refinement type checker plugin for Rust that lets you specify a range of correctness properties and have them be verified at compile time.
Flux works by extending Rust's types with refinements: logical assertions describing additional correctness requirements that are checked during compilation, thereby eliminating various classes of run-time problems.
You can try it on the online playground.
Better still, read the interactive tutorial, to learn how you can use Flux on your Rust code.