mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
async haxx (public Priority)
This commit is contained in:
parent
6de4f1a797
commit
41472032dc
3 changed files with 7 additions and 2 deletions
|
@ -56,7 +56,8 @@ pub fn codegen(
|
|||
#[allow(non_camel_case_types)]
|
||||
#(#cfgs)*
|
||||
pub struct #name<'a> {
|
||||
priority: &'a Priority,
|
||||
// PER: this is unsound
|
||||
pub priority: &'a Priority,
|
||||
}
|
||||
|
||||
#(#cfgs)*
|
||||
|
|
|
@ -165,6 +165,7 @@ pub fn codegen(
|
|||
let constructor = quote!(
|
||||
impl<#lt> #ident<#lt> {
|
||||
#[inline(always)]
|
||||
// pub const unsafe fn new(#arg) -> Self {
|
||||
pub unsafe fn new(#arg) -> Self {
|
||||
#ident {
|
||||
#(#values,)*
|
||||
|
|
|
@ -78,7 +78,7 @@ impl Priority {
|
|||
///
|
||||
/// Will overwrite the current Priority
|
||||
#[inline(always)]
|
||||
pub unsafe fn new(value: u8) -> Self {
|
||||
pub const unsafe fn new(value: u8) -> Self {
|
||||
Priority {
|
||||
inner: Cell::new(value),
|
||||
}
|
||||
|
@ -98,6 +98,9 @@ impl Priority {
|
|||
}
|
||||
}
|
||||
|
||||
// PER: not sure if this is a problem
|
||||
unsafe impl Sync for Priority {}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn assert_send<T>()
|
||||
where
|
||||
|
|
Loading…
Reference in a new issue