Skip to content

Commit

Permalink
Add Steal::is_stolen()
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Aug 8, 2024
1 parent 9337f7a commit 0a35ec7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_data_structures/src/steal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ impl<T> Steal<T> {
let value = value_ref.take();
value.expect("attempt to steal from stolen value")
}

pub fn is_stolen(&self) -> bool {
self.value.borrow().is_none()
}
}

impl<CTX, T: HashStable<CTX>> HashStable<CTX> for Steal<T> {
Expand Down

0 comments on commit 0a35ec7

Please sign in to comment.