From b1a59660754ccecaddf10aef1f85a999b2c5227f Mon Sep 17 00:00:00 2001
From: Jan Niehusmann <jan@gondor.com>
Date: Tue, 10 Sep 2024 12:43:40 +0000
Subject: [PATCH] Don't allow unreachable_patterns

The warning happening in beta will be rolled back (for now) according to
https://github.com/rust-lang/rust/issues/129352#issuecomment-2339084913

Until this change propagates to a beta release, we can live with the
warnings.
---
 rp2040-hal/src/uart/peripheral.rs | 1 -
 rp2040-hal/src/uart/writer.rs     | 2 --
 rp235x-hal/src/uart/peripheral.rs | 1 -
 rp235x-hal/src/uart/writer.rs     | 2 --
 4 files changed, 6 deletions(-)

diff --git a/rp2040-hal/src/uart/peripheral.rs b/rp2040-hal/src/uart/peripheral.rs
index 38f0b67fc..6435229db 100644
--- a/rp2040-hal/src/uart/peripheral.rs
+++ b/rp2040-hal/src/uart/peripheral.rs
@@ -449,7 +449,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for UartPeripheral<Enabled,
     }
 
     fn flush(&mut self) -> nb::Result<(), Self::Error> {
-        #[allow(unreachable_patterns)]
         super::writer::transmit_flushed(&self.device).map_err(|e| match e {
             WouldBlock => WouldBlock,
             Other(v) => match v {},
diff --git a/rp2040-hal/src/uart/writer.rs b/rp2040-hal/src/uart/writer.rs
index d2cc5ee52..47bc5a0aa 100644
--- a/rp2040-hal/src/uart/writer.rs
+++ b/rp2040-hal/src/uart/writer.rs
@@ -87,7 +87,6 @@ pub(crate) fn write_raw<'d>(
 pub(crate) fn write_full_blocking(rb: &RegisterBlock, data: &[u8]) {
     let mut temp = data;
 
-    #[allow(unreachable_patterns)]
     while !temp.is_empty() {
         temp = match write_raw(rb, temp) {
             Ok(remaining) => remaining,
@@ -280,7 +279,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for Writer<D, P> {
     }
 
     fn flush(&mut self) -> nb::Result<(), Self::Error> {
-        #[allow(unreachable_patterns)]
         transmit_flushed(&self.device).map_err(|e| match e {
             WouldBlock => WouldBlock,
             Other(v) => match v {},
diff --git a/rp235x-hal/src/uart/peripheral.rs b/rp235x-hal/src/uart/peripheral.rs
index d6077dede..95421d3b8 100644
--- a/rp235x-hal/src/uart/peripheral.rs
+++ b/rp235x-hal/src/uart/peripheral.rs
@@ -449,7 +449,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for UartPeripheral<Enabled,
     }
 
     fn flush(&mut self) -> nb::Result<(), Self::Error> {
-        #[allow(unreachable_patterns)]
         super::writer::transmit_flushed(&self.device).map_err(|e| match e {
             WouldBlock => WouldBlock,
             Other(v) => match v {},
diff --git a/rp235x-hal/src/uart/writer.rs b/rp235x-hal/src/uart/writer.rs
index d7aca61fd..ac9c4779c 100644
--- a/rp235x-hal/src/uart/writer.rs
+++ b/rp235x-hal/src/uart/writer.rs
@@ -87,7 +87,6 @@ pub(crate) fn write_raw<'d>(
 pub(crate) fn write_full_blocking(rb: &RegisterBlock, data: &[u8]) {
     let mut temp = data;
 
-    #[allow(unreachable_patterns)]
     while !temp.is_empty() {
         temp = match write_raw(rb, temp) {
             Ok(remaining) => remaining,
@@ -281,7 +280,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for Writer<D, P> {
     }
 
     fn flush(&mut self) -> nb::Result<(), Self::Error> {
-        #[allow(unreachable_patterns)]
         transmit_flushed(&self.device).map_err(|e| match e {
             WouldBlock => WouldBlock,
             Other(v) => match v {},