-pub trait TyDecoder<'tcx>: Decoder {
- const CLEAR_CROSS_CRATE: bool;
-
- fn tcx(&self) -> TyCtxt<'tcx>;
-
- fn peek_byte(&self) -> u8;
-
- fn position(&self) -> usize;
-
- fn cached_ty_for_shorthand<F>(&mut self, shorthand: usize, or_insert_with: F) -> Ty<'tcx>
- where
- F: FnOnce(&mut Self) -> Ty<'tcx>;
-
- fn with_position<F, R>(&mut self, pos: usize, f: F) -> R
- where
- F: FnOnce(&mut Self) -> R;
-
- fn positioned_at_shorthand(&self) -> bool {
- (self.peek_byte() & (SHORTHAND_OFFSET as u8)) != 0
+macro_rules! encodable_via_deref {
+ ($($t:ty),+) => {
+ $(impl<'tcx, E: TyEncoder<I = TyInterner<'tcx>>> Encodable<E> for $t {
+ fn encode(&self, e: &mut E) -> Result<(), E::Error> {
+ (**self).encode(e)
+ }
+ })*