diff --git a/rustfmt-core/rustfmt-lib/tests/source/issue-3550.rs b/rustfmt-core/rustfmt-lib/tests/source/issue-3550.rs new file mode 100644 index 00000000000..b6a34c06684 --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/source/issue-3550.rs @@ -0,0 +1,37 @@ +fn main() { + assert(long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long(), + ); + + assert!(long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long(),); +} + diff --git a/rustfmt-core/rustfmt-lib/tests/target/issue-3068.rs b/rustfmt-core/rustfmt-lib/tests/target/issue-3068.rs new file mode 100644 index 00000000000..198d6385e6e --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/target/issue-3068.rs @@ -0,0 +1,14 @@ +// rustfmt-hard_tabs: true +// rustfmt-single_line_if_else_max_width: 10 + +macro_rules! foo { + ($bar: expr, $t: ty) => { + $bar(|x| { + if x { + None + } else { + None + } + }) + }; +} diff --git a/rustfmt-core/rustfmt-lib/tests/target/issue-3550.rs b/rustfmt-core/rustfmt-lib/tests/target/issue-3550.rs new file mode 100644 index 00000000000..49fd8423cad --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/target/issue-3550.rs @@ -0,0 +1,39 @@ +fn main() { + assert( + long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long(), + ); + + assert!( + long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long() + .long(), + ); +} diff --git a/rustfmt-core/rustfmt-lib/tests/target/issue-3638.rs b/rustfmt-core/rustfmt-lib/tests/target/issue-3638.rs new file mode 100644 index 00000000000..8f63f10213d --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/target/issue-3638.rs @@ -0,0 +1,19 @@ +macro_rules! abait { + ($x:expr) => { + Ok(()) + }; +} + +mod a { + fn foo() -> Result<(), ()> { + unsafe { + ( + abait!( + proxy.load_account(ahc_client_end, TEST_ACCOUNT_ID.clone().as_mut().into()) + )?, + (), + ) + }; + Ok(()) + } +} diff --git a/rustfmt-core/rustfmt-lib/tests/target/issue-3858.rs b/rustfmt-core/rustfmt-lib/tests/target/issue-3858.rs new file mode 100644 index 00000000000..d06a615b160 --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/target/issue-3858.rs @@ -0,0 +1,12 @@ +// rustfmt-hard_tabs: true + +macro_rules! member_mut { + ($self:expr, $member:expr) => {{ + use self::Member::*; + let r = &mut *$self; + match $member { + A => &mut r.a, + B => &mut r.b, + } + }}; +} diff --git a/rustfmt-core/rustfmt-lib/tests/target/issue-3936.rs b/rustfmt-core/rustfmt-lib/tests/target/issue-3936.rs new file mode 100644 index 00000000000..88e73e12154 --- /dev/null +++ b/rustfmt-core/rustfmt-lib/tests/target/issue-3936.rs @@ -0,0 +1,9 @@ +// rustfmt-hard_tabs: true + +macro_rules! m { + ($a:expr) => { + if $a { + return; + } + }; +}