aboutsummaryrefslogtreecommitdiff
path: root/macros/src
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src')
-rw-r--r--macros/src/codegen/local_resources_struct.rs1
-rw-r--r--macros/src/syntax.rs21
-rw-r--r--macros/src/syntax/analyze.rs42
3 files changed, 21 insertions, 43 deletions
diff --git a/macros/src/codegen/local_resources_struct.rs b/macros/src/codegen/local_resources_struct.rs
index 309fd8d2..6bcf4fad 100644
--- a/macros/src/codegen/local_resources_struct.rs
+++ b/macros/src/codegen/local_resources_struct.rs
@@ -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();
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs
index 11b92c1b..09b2ab3d 100644
--- a/macros/src/syntax.rs
+++ b/macros/src/syntax.rs
@@ -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> {
diff --git a/macros/src/syntax/analyze.rs b/macros/src/syntax/analyze.rs
index 06b23f46..44960b9e 100644
--- a/macros/src/syntax/analyze.rs
+++ b/macros/src/syntax/analyze.rs
@@ -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 { .. })
+// }
+// }