about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-03-12 15:32:04 +0100
committerflip1995 <philipp.krones@embecosm.com>2021-03-12 15:32:35 +0100
commit99d05196d6d366e2b23a736232c8d53826738d43 (patch)
treefda4f99fbbb63e8fa6966e0872f5563492f0bd0e /src/tools
parent412ebc3972374d2a506457b077a58cc5b56664e4 (diff)
Clippy: HACK! Fix bootstrap error
This will be removed in the next sync, once beta is at 1.52. Until then
this hack avoids to put `cfg(bootstrap)` into Clippy.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs b/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs
index fad96c2d5c0..11660a8fe0d 100644
--- a/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs
@@ -203,8 +203,11 @@ struct MinifyingSugg<'a>(Sugg<'a>);
 
 impl<'a> MinifyingSugg<'a> {
     fn as_str(&self) -> &str {
-        let (Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s)) = &self.0;
-        s.as_ref()
+        // HACK: Don't sync to Clippy! Required because something with the `or_patterns` feature
+        // changed and this would now require parentheses.
+        match &self.0 {
+            Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s) => s.as_ref(),
+        }
     }
 
     fn into_sugg(self) -> Sugg<'a> {