Skip to content

Commit

Permalink
peel back trusted
Browse files Browse the repository at this point in the history
  • Loading branch information
enjhnsn2 committed Nov 22, 2024
1 parent 4795e3c commit 4380e47
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions kernel/src/collections/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,19 @@ pub trait Queue<T> {

/// If the queue isn't full, add a new element to the back of the queue.
/// Returns whether the element was added.
#[flux_rs::trusted_impl] // Unexpected Evar
// #[flux_rs::sig(fn(self: &strg Self, _) -> bool ensures self: Self)]
#[flux_rs::sig(fn(self: &strg Self, _) -> bool ensures self: Self)]
fn enqueue(&mut self, val: T) -> bool;

/// Add a new element to the back of the queue, poping one from the front if necessary.
#[flux_rs::trusted_impl] // Unexpected Evar
// #[flux_rs::sig(fn(self: &strg Self, _) -> Option<T> ensures self: Self)]
#[flux_rs::sig(fn(self: &strg Self, _) -> Option<T> ensures self: Self)]
fn push(&mut self, val: T) -> Option<T>;

/// Remove the element from the front of the queue.
#[flux_rs::trusted_impl] // Unexpected Evar
// #[flux_rs::sig(fn(self: &strg Self) -> Option<T> ensures self: Self)]
#[flux_rs::sig(fn(self: &strg Self) -> Option<T> ensures self: Self)]
fn dequeue(&mut self) -> Option<T>;

/// Remove and return one (the first) element that matches the predicate.
#[flux_rs::trusted_impl] // Unexpected evar
// #[flux_rs::sig(fn(self: &strg Self, _) -> Option<T> ensures self: Self)]
#[flux_rs::sig(fn(self: &strg Self, _) -> Option<T> ensures self: Self)]
fn remove_first_matching<F>(&mut self, f: F) -> Option<T>
where
F: Fn(&T) -> bool;
Expand Down

0 comments on commit 4380e47

Please sign in to comment.