Mark Unborrow as unsafe to implement

This commit is contained in:
Dario Nieuwenhuis
2021-05-19 23:21:31 +02:00
parent dc67d2f4a4
commit 105c8504b6
10 changed files with 37 additions and 37 deletions

View File

@ -7,7 +7,7 @@ use core::task::{Context, Poll};
use embassy::interrupt::{Interrupt, InterruptExt};
use embassy::traits::gpio::{WaitForAnyEdge, WaitForFallingEdge, WaitForRisingEdge};
use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::impl_unborrow;
use embassy_extras::unsafe_impl_unborrow;
use embedded_hal::digital::v2::InputPin;
use pac::exti::{regs, vals};
@ -214,7 +214,7 @@ pub trait Channel: sealed::Channel + Sized {
pub struct AnyChannel {
number: u8,
}
impl_unborrow!(AnyChannel);
unsafe_impl_unborrow!(AnyChannel);
impl sealed::Channel for AnyChannel {}
impl Channel for AnyChannel {
fn number(&self) -> usize {

View File

@ -2,7 +2,7 @@
use core::convert::Infallible;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::{impl_unborrow, unborrow};
use embassy_extras::{unborrow, unsafe_impl_unborrow};
use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
use crate::pac;
@ -254,7 +254,7 @@ impl AnyPin {
}
}
impl_unborrow!(AnyPin);
unsafe_impl_unborrow!(AnyPin);
impl Pin for AnyPin {
type ExtiChannel = crate::exti::AnyChannel;
}
@ -297,7 +297,7 @@ impl<T: Pin> OptionalPin for T {
#[derive(Clone, Copy, Debug)]
pub struct NoPin;
impl_unborrow!(NoPin);
unsafe_impl_unborrow!(NoPin);
impl sealed::OptionalPin for NoPin {}
impl OptionalPin for NoPin {
type Pin = AnyPin;