mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 06:15:45 +01:00
Old xtask test pass
This commit is contained in:
parent
7614b96fe4
commit
582c602912
64 changed files with 1418 additions and 316 deletions
|
|
@ -37,7 +37,6 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
|
|||
(&r.cfgs, &r.ty, false)
|
||||
}
|
||||
TaskLocal::Declared(r) => (&r.cfgs, &r.ty, true),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
has_cfgs |= !cfgs.is_empty();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#[allow(unused_extern_crates)]
|
||||
extern crate proc_macro;
|
||||
|
||||
use core::ops;
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
use indexmap::{IndexMap, IndexSet};
|
||||
|
|
@ -23,26 +22,6 @@ pub type Map<T> = IndexMap<Ident, T>;
|
|||
/// An order set
|
||||
pub type Set<T> = IndexSet<T>;
|
||||
|
||||
/// Immutable pointer
|
||||
pub struct P<T> {
|
||||
ptr: Box<T>,
|
||||
}
|
||||
|
||||
impl<T> P<T> {
|
||||
/// Boxes `x` making the value immutable
|
||||
pub fn new(x: T) -> P<T> {
|
||||
P { ptr: Box::new(x) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> ops::Deref for P<T> {
|
||||
type Target = T;
|
||||
|
||||
fn deref(&self) -> &T {
|
||||
&self.ptr
|
||||
}
|
||||
}
|
||||
|
||||
/// Execution context
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum Context<'a> {
|
||||
|
|
|
|||
|
|
@ -338,8 +338,8 @@ pub(crate) fn app(app: &App) -> Result<Analysis, syn::Error> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Priority ceiling
|
||||
pub type Ceiling = Option<u8>;
|
||||
// /// Priority ceiling
|
||||
// pub type Ceiling = Option<u8>;
|
||||
|
||||
/// Task priority
|
||||
pub type Priority = u8;
|
||||
|
|
@ -427,22 +427,22 @@ pub enum Ownership {
|
|||
},
|
||||
}
|
||||
|
||||
impl Ownership {
|
||||
/// Whether this resource needs to a lock at this priority level
|
||||
pub fn needs_lock(&self, priority: u8) -> bool {
|
||||
match self {
|
||||
Ownership::Owned { .. } | Ownership::CoOwned { .. } => false,
|
||||
|
||||
Ownership::Contended { ceiling } => {
|
||||
debug_assert!(*ceiling >= priority);
|
||||
|
||||
priority < *ceiling
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether this resource is exclusively owned
|
||||
pub fn is_owned(&self) -> bool {
|
||||
matches!(self, Ownership::Owned { .. })
|
||||
}
|
||||
}
|
||||
// impl Ownership {
|
||||
// /// Whether this resource needs to a lock at this priority level
|
||||
// pub fn needs_lock(&self, priority: u8) -> bool {
|
||||
// match self {
|
||||
// Ownership::Owned { .. } | Ownership::CoOwned { .. } => false,
|
||||
//
|
||||
// Ownership::Contended { ceiling } => {
|
||||
// debug_assert!(*ceiling >= priority);
|
||||
//
|
||||
// priority < *ceiling
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /// Whether this resource is exclusively owned
|
||||
// pub fn is_owned(&self) -> bool {
|
||||
// matches!(self, Ownership::Owned { .. })
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue