Fix feature gating on rustc_index to not use implicit features

This commit is contained in:
Michael Goulet 2024-07-15 12:44:24 -04:00
parent 247ad3385c
commit 324d2e51ee

View File

@ -1,4 +1,4 @@
#[cfg(feature = "rustc_serialize")] #[cfg(feature = "nightly")]
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::borrow::{Borrow, BorrowMut}; use std::borrow::{Borrow, BorrowMut};
@ -322,14 +322,14 @@ fn default() -> Self {
} }
} }
#[cfg(feature = "rustc_serialize")] #[cfg(feature = "nightly")]
impl<S: Encoder, I: Idx, T: Encodable<S>> Encodable<S> for IndexVec<I, T> { impl<S: Encoder, I: Idx, T: Encodable<S>> Encodable<S> for IndexVec<I, T> {
fn encode(&self, s: &mut S) { fn encode(&self, s: &mut S) {
Encodable::encode(&self.raw, s); Encodable::encode(&self.raw, s);
} }
} }
#[cfg(feature = "rustc_serialize")] #[cfg(feature = "nightly")]
impl<D: Decoder, I: Idx, T: Decodable<D>> Decodable<D> for IndexVec<I, T> { impl<D: Decoder, I: Idx, T: Decodable<D>> Decodable<D> for IndexVec<I, T> {
fn decode(d: &mut D) -> Self { fn decode(d: &mut D) -> Self {
IndexVec::from_raw(Vec::<T>::decode(d)) IndexVec::from_raw(Vec::<T>::decode(d))