Merge branch 'stm32-neo'

This commit is contained in:
Dario Nieuwenhuis
2021-05-17 02:16:17 +02:00
443 changed files with 317852 additions and 6 deletions

View File

@ -25,3 +25,44 @@ pub trait Unborrow {
pub trait Steal {
unsafe fn steal() -> Self;
}
macro_rules! impl_unborrow_tuples {
($($t:ident),+) => {
impl<$($t),+> Unborrow for ($($t),+)
where
$(
$t: Unborrow<Target = $t>
),+
{
type Target = ($($t),+);
unsafe fn unborrow(self) -> Self::Target {
self
}
}
impl<'a, $($t),+> Unborrow for &'a mut($($t),+)
where
$(
$t: Unborrow<Target = $t>
),+
{
type Target = ($($t),+);
unsafe fn unborrow(self) -> Self::Target {
::core::ptr::read(self)
}
}
};
}
impl_unborrow_tuples!(A, B);
impl_unborrow_tuples!(A, B, C);
impl_unborrow_tuples!(A, B, C, D);
impl_unborrow_tuples!(A, B, C, D, E);
impl_unborrow_tuples!(A, B, C, D, E, F);
impl_unborrow_tuples!(A, B, C, D, E, F, G);
impl_unborrow_tuples!(A, B, C, D, E, F, G, H);
impl_unborrow_tuples!(A, B, C, D, E, F, G, H, I);
impl_unborrow_tuples!(A, B, C, D, E, F, G, H, I, J);
impl_unborrow_tuples!(A, B, C, D, E, F, G, H, I, J, K);
impl_unborrow_tuples!(A, B, C, D, E, F, G, H, I, J, K, L);