1 use crate::runtime::vm::VMGcRef;
2 use crate::{
3     AsContextMut, GcRefImpl, Result, Rooted, StoreContext, StoreContextMut, store::AutoAssertNoGc,
4 };
5 use core::any::Any;
6 
7 /// Support for `externref` disabled at compile time because the `gc` cargo
8 /// feature was not enabled.
9 pub enum ExternRef {}
10 
11 impl GcRefImpl for ExternRef {}
12 
13 impl ExternRef {
from_cloned_gc_ref( _store: &mut AutoAssertNoGc<'_>, _gc_ref: VMGcRef, ) -> Rooted<Self>14     pub(crate) fn from_cloned_gc_ref(
15         _store: &mut AutoAssertNoGc<'_>,
16         _gc_ref: VMGcRef,
17     ) -> Rooted<Self> {
18         unreachable!()
19     }
20 
data<'a, T: 'static>( &self, _store: impl Into<StoreContext<'a, T>>, ) -> Result<&'a (dyn Any + Send + Sync)> where T: 'a,21     pub fn data<'a, T: 'static>(
22         &self,
23         _store: impl Into<StoreContext<'a, T>>,
24     ) -> Result<&'a (dyn Any + Send + Sync)>
25     where
26         T: 'a,
27     {
28         match *self {}
29     }
30 
data_mut<'a, T: 'static>( &self, _store: impl Into<StoreContextMut<'a, T>>, ) -> Result<&'a mut (dyn Any + Send + Sync)> where T: 'a,31     pub fn data_mut<'a, T: 'static>(
32         &self,
33         _store: impl Into<StoreContextMut<'a, T>>,
34     ) -> Result<&'a mut (dyn Any + Send + Sync)>
35     where
36         T: 'a,
37     {
38         match *self {}
39     }
40 
from_raw(_store: impl AsContextMut, raw: u32) -> Option<Rooted<Self>>41     pub fn from_raw(_store: impl AsContextMut, raw: u32) -> Option<Rooted<Self>> {
42         assert_eq!(raw, 0);
43         None
44     }
45 
_from_raw(_store: &mut AutoAssertNoGc<'_>, raw: u32) -> Option<Rooted<Self>>46     pub fn _from_raw(_store: &mut AutoAssertNoGc<'_>, raw: u32) -> Option<Rooted<Self>> {
47         assert_eq!(raw, 0);
48         None
49     }
50 
to_raw(&self, _store: impl AsContextMut) -> Result<u32>51     pub fn to_raw(&self, _store: impl AsContextMut) -> Result<u32> {
52         match *self {}
53     }
54 }
55