Skip to content

Commit f2585eb

Browse files
author
Tage Johansson
committed
in rustc_index: revert "fix compilation error by changing the rustc_serialize dependency to be required instead of optional", and introduce conditional compilation instead.
1 parent 042debb commit f2585eb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/rustc_index/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ edition = "2024"
88
itertools = "0.12"
99
rustc_index_macros = { path = "../rustc_index_macros" }
1010
rustc_macros = { path = "../rustc_macros", optional = true }
11-
rustc_serialize = { path = "../rustc_serialize" }
11+
rustc_serialize = { path = "../rustc_serialize", optional = true }
1212
smallvec = "1.8.1"
1313
# tidy-alphabetical-end
1414

1515
[features]
1616
# tidy-alphabetical-start
1717
default = ["nightly"]
1818
nightly = [
19+
"dep:rustc_serialize",
1920
"dep:rustc_macros",
2021
"rustc_index_macros/nightly",
2122
]

compiler/rustc_index/src/bit_set/dense_bit_set.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::ptr::NonNull;
88
use std::{fmt, iter, slice};
99

1010
use itertools::Either;
11+
#[cfg(feature = "nightly")]
1112
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
1213

1314
use super::{
@@ -781,6 +782,7 @@ impl<T: Idx> BitRelations<ChunkedBitSet<T>> for DenseBitSet<T> {
781782
}
782783
}
783784

785+
#[cfg(feature = "nightly")]
784786
impl<S: Encoder, T> Encodable<S> for DenseBitSet<T> {
785787
#[inline(never)] // FIXME: For profiling purposes
786788
fn encode(&self, s: &mut S) {
@@ -815,6 +817,7 @@ impl<S: Encoder, T> Encodable<S> for DenseBitSet<T> {
815817
}
816818
}
817819

820+
#[cfg(feature = "nightly")]
818821
impl<D: Decoder, T> Decodable<D> for DenseBitSet<T> {
819822
#[inline(never)] // FIXME: For profiling purposes
820823
fn decode(d: &mut D) -> Self {

0 commit comments

Comments
 (0)