I have a file with #[cfg_attr(target_vendor = "nintendo64", path = "graphics.rs")] #[cfg_attr(not(target_vendor = "nintendo64"), path = "graphics_emu.rs")] pub mod graphics; So when i run cargo fmt the contents of the file graphics_emu.rs is written to the file graphics.rs. I would expect them both to be formatted and kept in their separate files.