about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-12-23 02:07:32 -0500
committerGitHub <noreply@github.com>2024-12-23 02:07:32 -0500
commitc9c90dc4b568f3f67eee59a7c056d2ec479123e0 (patch)
tree01067bb2a93bf60ef0085b9206b4564704f2ae21 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentfde85a8e5f029ae8b064faec6af5ca8a9501006d (diff)
parent68c46e13a25c4f1eb8cdcd33c407cdd0cd53529b (diff)
downloadrust-c9c90dc4b568f3f67eee59a7c056d2ec479123e0.tar.gz
rust-c9c90dc4b568f3f67eee59a7c056d2ec479123e0.zip
Rollup merge of #134668 - compiler-errors:default-struct-value-fmt, r=ytmimi
Make sure we don't lose default struct value when formatting struct

The reason why https://github.com/rust-lang/rustfmt/issues/6424 broke when https://github.com/rust-lang/rust/pull/129514 landed is because the parser now *successfully* parses default struct values. That means that where we used to fail in `rewrite_macro_inner`:

https://github.com/rust-lang/rust/blob/e108481f74ff123ad98a63bd107a18d13035b275/src/tools/rustfmt/src/macros.rs#L263-L267

... we now succeed, and we now proceed to format the inner struct as a macro arg. Since formatting was never implemented for default struct values, this means that we’ll always rewrite the struct to exclude the default value.

This PR makes it so that we simply don’t rewrite struct fields if they have a default value.

r? `@ytmimi`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions