Skip to content

deny.toml

Put this file at your repository root and run cargo deny check bans. It rejects dependencies that run code before main().

Download deny.toml

deny.toml
# cargo-deny configuration for the Google Rust style guide. Run with `cargo deny check bans`.
# Guide: https://google.github.io/styleguide/rustguide.html
[graph]
all-features = true
[bans]
multiple-versions = "warn"
deny = [
# #do-not-run-code-before-main: these crates run code before `main()` via linker sections.
{ crate = "ctor", reason = "runs code before main() (guide: do not run code before main)" },
{ crate = "inventory", reason = "registers items before main() through ctor-style constructors (guide: do not run code before main)" },
{ crate = "static_init", reason = "runs initializers before main() (guide: do not run code before main)" },
]

Source: deny.toml on GitHub. New to the kit? Start with the quick start.

Unofficial community project, not affiliated with or endorsed by Google. TheGoogle Rust Style Guide is published by Google under CC-BY 3.0. This kit is Apache-2.0.