Skip to content

Commit

Permalink
Fix some tidy errors in ty::codec.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Nov 16, 2017
1 parent cb1ff24 commit 4c4f7a3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/librustc/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,45 +318,52 @@ macro_rules! implement_ty_decoder {
// the caller to pick any lifetime for 'tcx, including 'static,
// by using the unspecialized proxies to them.

impl<$($typaram),*> SpecializedDecoder<CrateNum> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<CrateNum>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<CrateNum, Self::Error> {
decode_cnum(self)
}
}

impl<$($typaram),*> SpecializedDecoder<ty::Ty<'tcx>> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<ty::Ty<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<ty::Ty<'tcx>, Self::Error> {
decode_ty(self)
}
}

impl<$($typaram),*> SpecializedDecoder<ty::GenericPredicates<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<ty::GenericPredicates<'tcx>, Self::Error> {
fn specialized_decode(&mut self)
-> Result<ty::GenericPredicates<'tcx>, Self::Error> {
decode_predicates(self)
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx Substs<'tcx>> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<&'tcx Substs<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<&'tcx Substs<'tcx>, Self::Error> {
decode_substs(self)
}
}

impl<$($typaram),*> SpecializedDecoder<ty::Region<'tcx>> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<ty::Region<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<ty::Region<'tcx>, Self::Error> {
decode_region(self)
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx ty::Slice<ty::Ty<'tcx>>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<&'tcx ty::Slice<ty::Ty<'tcx>>, Self::Error> {
fn specialized_decode(&mut self)
-> Result<&'tcx ty::Slice<ty::Ty<'tcx>>, Self::Error> {
decode_ty_slice(self)
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx ty::AdtDef> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<&'tcx ty::AdtDef>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<&'tcx ty::AdtDef, Self::Error> {
decode_adt_def(self)
}
Expand All @@ -370,7 +377,8 @@ macro_rules! implement_ty_decoder {
}
}

impl<$($typaram),*> SpecializedDecoder<ByteArray<'tcx>> for $DecoderName<$($typaram),*> {
impl<$($typaram),*> SpecializedDecoder<ByteArray<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<ByteArray<'tcx>, Self::Error> {
decode_byte_array(self)
}
Expand Down

0 comments on commit 4c4f7a3

Please sign in to comment.