Google's Rust Style Guide Goes Public
Google has published a comprehensive Rust style guide covering formatting, API design, code organization, ownership, concurrency, safety, and testing. The guide targets consistent, maintainable Rust across Google, Android, Chromium, Fuchsia, and Chrome.
This is less a formatting document than an operating standard for Rust at monorepo scale—and a useful specification for both human reviewers and AI coding agents.
- –Extends beyond rustfmt into API design, error handling, traits, ownership, concurrency, and unsafe-code discipline
- –Optimizes for large-scale refactoring with small crates, flat Chromium layouts, explicit imports, and predictable naming
- –Favors maintainability through `non_exhaustive` public APIs, `expect` over `unwrap`, contextual assertions, and documented safety boundaries
- –Balances Google-specific rules with the broader Rust Style Guide and Rust API Guidelines
- –Gives coding agents a concrete style target, though automated enforcement and meaningful review remain essential
DISCOVERED
1h ago
2026-10-21
PUBLISHED
2h ago
2026-10-21
RELEVANCE
AUTHOR
kaycebasques