How to exclude main binary from benchmark?

Hello. When i trying to benchmark (cargo bench) cargo build main binary in release, i only want to build benchmark in benches folder. How to exclude main bin?

It's not possible to do within a single crate. Cargo assumes you may need binaries in your "tests", and benches are compiled as a kind of a test.

You have to split your crate into a library-only crate and a separate binary-only crate that uses the library one.