We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Steal::is_stolen()
1 parent 9337f7a commit 09ae438Copy full SHA for 09ae438
compiler/rustc_data_structures/src/steal.rs
@@ -51,6 +51,12 @@ impl<T> Steal<T> {
51
let value = value_ref.take();
52
value.expect("attempt to steal from stolen value")
53
}
54
+
55
+ /// Writers of rustc drivers often encounter stealing issues. This function makes it possible to
56
+ /// handle these errors gracefully. This is not used within rustc as the time of writing.
57
+ pub fn is_stolen(&self) -> bool {
58
+ self.value.borrow().is_none()
59
+ }
60
61
62
impl<CTX, T: HashStable<CTX>> HashStable<CTX> for Steal<T> {
0 commit comments