# 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](/Google-Rust-Style-Guide/files/deny.toml)

```toml title="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](https://github.com/DaniAkash/Google-Rust-Style-Guide/blob/main/deny.toml). New to the kit? Start with the [quick start](/Google-Rust-Style-Guide/quick-start/).