Skip to content

Commit

Permalink
Add rustfmt test for mut ref mut
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-Bertholet committed Mar 27, 2024
1 parent 528d45a commit 2ab563f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tools/rustfmt/tests/source/issue_3853.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ if let Some(ref /*def*/ mut /*abc*/ state)= /*abc*/foo{
println!(
"asdfasdfasdf"); }
}

fn mut_ref_mut() {
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"); }
}
10 changes: 10 additions & 0 deletions src/tools/rustfmt/tests/target/issue_3853.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ fn block_comment_between_lhs_and_rhs() {
println!("asdfasdfasdf");
}
}

fn mut_ref_mut() {
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");
}
}

0 comments on commit 2ab563f

Please sign in to comment.