From 9fd34e0c7522fd52bf7d015de4ed78c24596498b Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 22 May 2023 20:02:45 -0400 Subject: [PATCH] Use #[rustfmt::skip] --- tests/ui/single_match.rs | 2 +- tests/ui/single_match.stderr | 3 +-- tests/ui/single_match_else.rs | 8 ++++---- tests/ui/single_match_else.stderr | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs index d474088aa..3455ca553 100644 --- a/tests/ui/single_match.rs +++ b/tests/ui/single_match.rs @@ -255,8 +255,8 @@ fn issue_10808(bar: Option) { } match bar { + #[rustfmt::skip] Some(v) => { - // this comment prevents rustfmt from collapsing the block unsafe { let r = &v as *const i32; println!("{}", *r); diff --git a/tests/ui/single_match.stderr b/tests/ui/single_match.stderr index 810f153fe..dad66e2ab 100644 --- a/tests/ui/single_match.stderr +++ b/tests/ui/single_match.stderr @@ -179,8 +179,8 @@ error: you seem to be trying to use `match` for destructuring a single pattern. --> $DIR/single_match.rs:257:5 | LL | / match bar { +LL | | #[rustfmt::skip] LL | | Some(v) => { -LL | | // this comment prevents rustfmt from collapsing the block LL | | unsafe { ... | LL | | _ => {}, @@ -190,7 +190,6 @@ LL | | } help: try this | LL ~ if let Some(v) = bar { -LL + // this comment prevents rustfmt from collapsing the block LL + unsafe { LL + let r = &v as *const i32; LL + println!("{}", *r); diff --git a/tests/ui/single_match_else.rs b/tests/ui/single_match_else.rs index 768316eda..ec97bfc84 100644 --- a/tests/ui/single_match_else.rs +++ b/tests/ui/single_match_else.rs @@ -153,8 +153,8 @@ fn issue_10808(bar: Option) { } match bar { + #[rustfmt::skip] Some(v) => { - // this comment prevents rustfmt from collapsing the block unsafe { let r = &v as *const i32; println!("{}", *r); @@ -171,8 +171,8 @@ fn issue_10808(bar: Option) { println!("Some"); println!("{v}"); }, + #[rustfmt::skip] None => { - // this comment prevents rustfmt from collapsing the block unsafe { let v = 0; let r = &v as *const i32; @@ -182,15 +182,15 @@ fn issue_10808(bar: Option) { } match bar { + #[rustfmt::skip] Some(v) => { - // this comment prevents rustfmt from collapsing the block unsafe { let r = &v as *const i32; println!("{}", *r); } }, + #[rustfmt::skip] None => { - // this comment prevents rustfmt from collapsing the block unsafe { let v = 0; let r = &v as *const i32; diff --git a/tests/ui/single_match_else.stderr b/tests/ui/single_match_else.stderr index 6537156d5..228236f3b 100644 --- a/tests/ui/single_match_else.stderr +++ b/tests/ui/single_match_else.stderr @@ -175,8 +175,8 @@ error: you seem to be trying to use `match` for destructuring a single pattern. --> $DIR/single_match_else.rs:155:5 | LL | / match bar { +LL | | #[rustfmt::skip] LL | | Some(v) => { -LL | | // this comment prevents rustfmt from collapsing the block LL | | unsafe { ... | LL | | }, @@ -186,7 +186,6 @@ LL | | } help: try this | LL ~ if let Some(v) = bar { -LL + // this comment prevents rustfmt from collapsing the block LL + unsafe { LL + let r = &v as *const i32; LL + println!("{}", *r);