rust/tests/target/issue-4926/deeply_nested_struct.rs
Yacin Tmimi d41805704d Prevent structs with ".." from being rewritten with alignment
rustfmt should only support rewriting a struct in an expression
 position with alignment (non-default behavior) when there is no rest
 (with or without a base) and all of the fields are non-shorthand.
2021-10-12 19:37:48 -05:00

39 lines
884 B
Rust

// rustfmt-struct_field_align_threshold: 30
struct X {
a: i32,
b: i32,
c: i32,
}
fn test(x: X) {
let d = {
let e = {
let f = {
let g = {
let h = {
let i = {
let j = {
matches!(
x,
X {
a: 1_000,
b: 1_000,
..
}
)
};
j
};
i
};
h
};
g
};
f
};
e
};
}