From e9315959099d081f0c44aeb6f56784eae1618aa1 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Wed, 27 Mar 2024 16:35:40 -0400 Subject: [PATCH] Add rustfmt test for mut ref mut --- src/tools/rustfmt/tests/source/mut_ref.rs | 10 ++++++++++ src/tools/rustfmt/tests/target/mut_ref.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/tools/rustfmt/tests/source/mut_ref.rs create mode 100644 src/tools/rustfmt/tests/target/mut_ref.rs diff --git a/src/tools/rustfmt/tests/source/mut_ref.rs b/src/tools/rustfmt/tests/source/mut_ref.rs new file mode 100644 index 00000000000..18ff33a99ce --- /dev/null +++ b/src/tools/rustfmt/tests/source/mut_ref.rs @@ -0,0 +1,10 @@ +#![feature(mut_ref)] +fn mut_ref() { + if let Some(mut /*a*/ ref /*def*/ mut /*abc*/ state)= /*abc*/foo{ + println!( +"asdfasdfasdf"); } + +if let Some(mut /*a*/ ref /*def*/ /*mut*/ state)= /*abc*/foo{ + println!( +"asdfasdfasdf"); } +} diff --git a/src/tools/rustfmt/tests/target/mut_ref.rs b/src/tools/rustfmt/tests/target/mut_ref.rs new file mode 100644 index 00000000000..16035243791 --- /dev/null +++ b/src/tools/rustfmt/tests/target/mut_ref.rs @@ -0,0 +1,10 @@ +#![feature(mut_ref)] +fn mut_ref() { + if let Some(mut /*a*/ ref /*def*/ mut /*abc*/ state) = /*abc*/ foo { + println!("asdfasdfasdf"); + } + + if let Some(mut /*a*/ ref /*def*/ /*mut*/ state) = /*abc*/ foo { + println!("asdfasdfasdf"); + } +}