Skip to content
Unverified Commit bbdde4bb authored by Harry Barber's avatar Harry Barber Committed by GitHub
Browse files

Fix RustWriter debug mode (#1523)

Debug mode is useful for tracing the origin of generated code. Currently `./gradlew codegen-server-test:check` will fail with it enabled.

This is caused by the following `rustfmt` bug https://github.com/rust-lang/rustfmt/issues/5425 which causes valid rust code to break after `cargo fmt`. One instance of this pattern is generated by `withBlock("$memberName: self.$memberName", ",")` found [here](https://github.com/awslabs/smithy-rs/blob/46984ab91d027e6a4d1e312c125a850f5cb23cfd/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/BuilderGenerator.kt#L252).

To prevent such code being generated we disallow debug comment being introduced when the line is just a single `,`.
parent 1338063c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment