Ok(())
}
-pub trait TyDecoder<'a, 'tcx: 'a>: Decoder {
-
- fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx>;
+pub trait TyDecoder<'tcx>: Decoder {
+ fn tcx(&self) -> TyCtxt<'tcx, 'tcx>;
fn peek_byte(&self) -> u8;
}
#[inline]
-pub fn decode_arena_allocable<'a, 'tcx, D, T: ArenaAllocatable + Decodable>(
- decoder: &mut D
+pub fn decode_arena_allocable<D, T: ArenaAllocatable + Decodable>(
+ decoder: &mut D,
) -> Result<&'tcx T, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+where
+ D: TyDecoder<'tcx>,
{
Ok(decoder.tcx().arena.alloc(Decodable::decode(decoder)?))
}
#[inline]
-pub fn decode_arena_allocable_slice<'a, 'tcx, D, T: ArenaAllocatable + Decodable>(
- decoder: &mut D
+pub fn decode_arena_allocable_slice<D, T: ArenaAllocatable + Decodable>(
+ decoder: &mut D,
) -> Result<&'tcx [T], D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+where
+ D: TyDecoder<'tcx>,
{
Ok(decoder.tcx().arena.alloc_from_iter(<Vec<T> as Decodable>::decode(decoder)?))
}
#[inline]
-pub fn decode_cnum<'a, 'tcx, D>(decoder: &mut D) -> Result<CrateNum, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_cnum<D>(decoder: &mut D) -> Result<CrateNum, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let cnum = CrateNum::from_u32(u32::decode(decoder)?);
Ok(decoder.map_encoded_cnum_to_current(cnum))
}
#[inline]
-pub fn decode_ty<'a, 'tcx, D>(decoder: &mut D) -> Result<Ty<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_ty<D>(decoder: &mut D) -> Result<Ty<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
// Handle shorthands first, if we have an usize > 0x80.
if decoder.positioned_at_shorthand() {
}
#[inline]
-pub fn decode_predicates<'a, 'tcx, D>(decoder: &mut D)
- -> Result<ty::GenericPredicates<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_predicates<D>(decoder: &mut D) -> Result<ty::GenericPredicates<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
Ok(ty::GenericPredicates {
parent: Decodable::decode(decoder)?,
}
#[inline]
-pub fn decode_substs<'a, 'tcx, D>(decoder: &mut D) -> Result<SubstsRef<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_substs<D>(decoder: &mut D) -> Result<SubstsRef<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let len = decoder.read_usize()?;
let tcx = decoder.tcx();
}
#[inline]
-pub fn decode_region<'a, 'tcx, D>(decoder: &mut D) -> Result<ty::Region<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_region<D>(decoder: &mut D) -> Result<ty::Region<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
Ok(decoder.tcx().mk_region(Decodable::decode(decoder)?))
}
#[inline]
-pub fn decode_ty_slice<'a, 'tcx, D>(decoder: &mut D)
- -> Result<&'tcx ty::List<Ty<'tcx>>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_ty_slice<D>(decoder: &mut D) -> Result<&'tcx ty::List<Ty<'tcx>>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let len = decoder.read_usize()?;
Ok(decoder.tcx().mk_type_list((0..len).map(|_| Decodable::decode(decoder)))?)
}
#[inline]
-pub fn decode_adt_def<'a, 'tcx, D>(decoder: &mut D)
- -> Result<&'tcx ty::AdtDef, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_adt_def<D>(decoder: &mut D) -> Result<&'tcx ty::AdtDef, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let def_id = DefId::decode(decoder)?;
Ok(decoder.tcx().adt_def(def_id))
}
#[inline]
-pub fn decode_existential_predicate_slice<'a, 'tcx, D>(decoder: &mut D)
- -> Result<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_existential_predicate_slice<D>(
+ decoder: &mut D,
+) -> Result<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let len = decoder.read_usize()?;
Ok(decoder.tcx()
}
#[inline]
-pub fn decode_canonical_var_infos<'a, 'tcx, D>(decoder: &mut D)
- -> Result<CanonicalVarInfos<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_canonical_var_infos<D>(decoder: &mut D) -> Result<CanonicalVarInfos<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
let len = decoder.read_usize()?;
let interned: Result<Vec<CanonicalVarInfo>, _> = (0..len).map(|_| Decodable::decode(decoder))
}
#[inline]
-pub fn decode_const<'a, 'tcx, D>(decoder: &mut D)
- -> Result<&'tcx ty::Const<'tcx>, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_const<D>(decoder: &mut D) -> Result<&'tcx ty::Const<'tcx>, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
Ok(decoder.tcx().mk_const(Decodable::decode(decoder)?))
}
#[inline]
-pub fn decode_allocation<'a, 'tcx, D>(decoder: &mut D)
- -> Result<&'tcx Allocation, D::Error>
- where D: TyDecoder<'a, 'tcx>,
- 'tcx: 'a,
+pub fn decode_allocation<D>(decoder: &mut D) -> Result<&'tcx Allocation, D::Error>
+where
+ D: TyDecoder<'tcx>,
{
Ok(decoder.tcx().intern_const_alloc(Decodable::decode(decoder)?))
}