Old xtask test pass

This commit is contained in:
Emil Fresk 2023-01-02 14:34:05 +01:00 committed by Henrik Tjäder
parent 7614b96fe4
commit 582c602912
64 changed files with 1418 additions and 316 deletions

View file

@ -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();

View file

@ -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> {

View file

@ -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 { .. })
// }
// }