Skip to content

Commit 0a35ec7

Browse files
committed
Add Steal::is_stolen()
1 parent 9337f7a commit 0a35ec7

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_data_structures/src

1 file changed

+4
-0
lines changed

compiler/rustc_data_structures/src/steal.rs

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ impl<T> Steal<T> {
5151
let value = value_ref.take();
5252
value.expect("attempt to steal from stolen value")
5353
}
54+
55+
pub fn is_stolen(&self) -> bool {
56+
self.value.borrow().is_none()
57+
}
5458
}
5559

5660
impl<CTX, T: HashStable<CTX>> HashStable<CTX> for Steal<T> {

0 commit comments

Comments
 (0)