We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
assert_crate_local
ClearCrossCrate
1 parent 37db94d commit 351e78dCopy full SHA for 351e78d
src/librustc/mir/mod.rs
@@ -380,6 +380,15 @@ pub enum ClearCrossCrate<T> {
380
Set(T),
381
}
382
383
+impl<T> ClearCrossCrate<T> {
384
+ pub fn assert_crate_local(self) -> T {
385
+ match self {
386
+ ClearCrossCrate::Clear => bug!("unwrapping cross-crate data"),
387
+ ClearCrossCrate::Set(v) => v,
388
+ }
389
390
+}
391
+
392
impl<T: serialize::Encodable> serialize::UseSpecializedEncodable for ClearCrossCrate<T> {}
393
impl<T: serialize::Decodable> serialize::UseSpecializedDecodable for ClearCrossCrate<T> {}
394
0 commit comments