Skip to content

Commit efd062f

Browse files
chore: Remove rustdoc-types fork. Upgrade to latest nightly.
1 parent 85e5422 commit efd062f

14 files changed

Lines changed: 82 additions & 2327 deletions

File tree

Cargo.lock

Lines changed: 51 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ rustdoc_processor = { path = "rustdoc/rustdoc_processor", version = "0.2.10" }
4141
rustdoc_resolver = { path = "rustdoc/rustdoc_resolver", version = "0.2.10" }
4242
pavexc_annotations = { path = "compiler/pavexc_annotations", version = "0.2.10" }
4343
persist_if_changed = { path = "compiler/persist_if_changed", version = "0.2.10" }
44-
# Our own fork of `rustdoc-types` to minimise (de)ser overhead.
45-
rustdoc-types = { path = "rustdoc/rustdoc_types", version = "0.2.10", features = ["rustc-hash"], package = "rustdoc_types" }
4644

45+
rustdoc-types = { version = "0.57.3", features = ["rustc-hash", "rkyv_0_8" ] }
4746
vergen-gitcl = { version = "1.0.8", features = ["build"] }
4847
ahash = "0.8"
4948
anstyle = "1.0.13"

compiler/pavexc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ mod utils;
1414

1515
/// The Rust toolchain used by `pavexc` to generate JSON docs, unless
1616
/// overridden by the user.
17-
pub static DEFAULT_DOCS_TOOLCHAIN: &str = "nightly-2025-12-15";
17+
pub static DEFAULT_DOCS_TOOLCHAIN: &str = "nightly-2026-05-01";

compiler/pavexc/src/rustdoc/cache.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
use guppy::graph::PackageGraph;
44

55
use rustdoc_processor::cache::RustdocGlobalFsCache;
6+
use serde::de::DeserializeOwned;
67

78
/// Construct a [`RustdocGlobalFsCache`] pre-configured with Pavex's cache fingerprint
89
/// and default cache directory (`~/.pavex/rustdoc/cache`).
9-
pub(crate) fn pavex_rustdoc_cache<A: Default + bincode::Decode<()>>(
10+
pub(crate) fn pavex_rustdoc_cache<A: Default + DeserializeOwned>(
1011
toolchain_name: &str,
1112
cache_workspace_package_docs: bool,
1213
package_graph: &PackageGraph,

compiler/pavexc_annotations/src/process.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::borrow::Cow;
44
use std::collections::BTreeSet;
55

66
use pavexc_attr_parser::{AnnotationKind, AnnotationProperties};
7-
use rustdoc_ext::ItemEnumExt;
87
use rustdoc_types::{Enum, Item, ItemEnum, Struct, Trait};
98

109
use crate::errors::AnnotationError;

compiler/pavexc_annotations/src/types.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use pavex_bp_schema::CreatedAt;
66
use pavexc_attr_parser::AnnotationProperties;
77

88
/// All the annotated items for a given package.
9-
#[derive(
10-
Default, Debug, Clone, serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode,
11-
)]
9+
#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
1210
pub struct AnnotatedItems {
1311
item_id2details: BTreeMap<rustdoc_types::Id, AnnotatedItem>,
1412
annotation_id2item_id: BTreeMap<String, rustdoc_types::Id>,
@@ -63,7 +61,7 @@ pub struct IdConflict {
6361
}
6462

6563
/// An item decorated with a Pavex annotation.
66-
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode)]
64+
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
6765
pub struct AnnotatedItem {
6866
/// The identifier of the annotated item.
6967
pub id: rustdoc_types::Id,
@@ -74,7 +72,7 @@ pub struct AnnotatedItem {
7472
}
7573

7674
/// Information about the `impl` block the item belongs to, if any.
77-
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode)]
75+
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
7876
pub struct ImplInfo {
7977
/// The `id` of the item this `impl` block was attached to.
8078
/// For inherent methods, that's the `Self` type.

rustdoc/rustdoc_processor/src/cache/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mod toolchain;
77
pub mod utils;
88

99
pub use entry::{CacheEntry, SecondaryIndexes};
10+
use serde::de::DeserializeOwned;
1011
pub use utils::RkyvCowBytes;
1112

1213
use std::collections::BTreeSet;
@@ -126,7 +127,7 @@ impl<'a> RustdocCacheKey<'a> {
126127
}
127128
}
128129

129-
impl<A: bincode::Decode<()> + Default> RustdocGlobalFsCache<A> {
130+
impl<A: DeserializeOwned + Default> RustdocGlobalFsCache<A> {
130131
/// Initialize a new instance of the cache.
131132
///
132133
/// The `cache_fingerprint` is used to determine the database file name.

rustdoc/rustdoc_processor/src/cache/third_party.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use camino::Utf8Path;
77
use guppy::graph::feature::StandardFeatures;
88
use guppy::graph::{PackageGraph, PackageMetadata};
99
use rusqlite::params;
10+
use serde::de::DeserializeOwned;
1011
use tracing::instrument;
1112
use tracing_log_error::log_error;
1213

@@ -44,14 +45,14 @@ impl ThirdPartyCrateCache {
4445
level=tracing::Level::DEBUG,
4546
fields(crate.id = %package_metadata.id(), cache_key = tracing::field::Empty, hit = tracing::field::Empty)
4647
)]
47-
pub(super) fn get<A: bincode::Decode<()> + Default>(
48+
pub(super) fn get<A: DeserializeOwned + Default>(
4849
&self,
4950
package_metadata: &PackageMetadata,
5051
cargo_fingerprint: &str,
5152
connection: &rusqlite::Connection,
5253
package_graph: &PackageGraph,
5354
) -> Result<Option<HydratedCacheEntry<A>>, anyhow::Error> {
54-
fn _get<A: bincode::Decode<()> + Default>(
55+
fn _get<A: DeserializeOwned + Default>(
5556
package_metadata: &PackageMetadata,
5657
cargo_fingerprint: &str,
5758
connection: &rusqlite::Connection,

rustdoc/rustdoc_processor/src/cache/toolchain.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::borrow::Cow;
44

55
use guppy::PackageId;
66
use rusqlite::params;
7+
use serde::de::DeserializeOwned;
78
use tracing::instrument;
89

910
use super::entry::{CacheEntry, SecondaryIndexes};
@@ -31,7 +32,7 @@ impl ToolchainCache {
3132
level=tracing::Level::DEBUG,
3233
fields(crate.name = %name)
3334
)]
34-
pub(super) fn get<A: bincode::Decode<()> + Default>(
35+
pub(super) fn get<A: DeserializeOwned + Default>(
3536
&self,
3637
name: &str,
3738
cargo_fingerprint: &str,
@@ -167,17 +168,20 @@ impl CacheEntry<'_> {
167168
/// We hydrate all mappings eagerly, but we avoid re-hydrating the item index eagerly,
168169
/// since it can be quite large and deserialization can be slow for large crates.
169170
/// The item index is stored as rkyv-serialized bytes for zero-copy access.
170-
pub fn hydrate<A: bincode::Decode<()> + Default>(
171+
pub fn hydrate<A: DeserializeOwned + Default>(
171172
self,
172173
package_id: PackageId,
173174
) -> Result<HydratedCacheEntry<A>, anyhow::Error> {
174175
use anyhow::Context;
175176

176177
let crate_data = CrateData {
177178
root_item_id: rustdoc_types::Id(self.root_item_id.to_owned()),
178-
external_crates: bincode::decode_from_slice(&self.external_crates, BINCODE_CONFIG)
179-
.context("Failed to deserialize external_crates")?
180-
.0,
179+
external_crates: bincode::serde::decode_from_slice(
180+
&self.external_crates,
181+
BINCODE_CONFIG,
182+
)
183+
.context("Failed to deserialize external_crates")?
184+
.0,
181185
paths: CrateItemPaths::Lazy(LazyCrateItemPaths {
182186
bytes: self.paths.into_owned(),
183187
}),
@@ -191,16 +195,17 @@ impl CacheEntry<'_> {
191195
};
192196

193197
let import_index =
194-
bincode::decode_from_slice(&secondary_indexes.import_index, BINCODE_CONFIG)
198+
bincode::serde::decode_from_slice(&secondary_indexes.import_index, BINCODE_CONFIG)
195199
.context("Failed to deserialize import_index")?
196200
.0;
197201

198-
let re_exports = bincode::decode_from_slice(&secondary_indexes.re_exports, BINCODE_CONFIG)
199-
.context("Failed to deserialize re-exports")?
200-
.0;
202+
let re_exports =
203+
bincode::serde::decode_from_slice(&secondary_indexes.re_exports, BINCODE_CONFIG)
204+
.context("Failed to deserialize re-exports")?
205+
.0;
201206

202207
let annotated_items: A = if let Some(data) = secondary_indexes.annotated_items {
203-
bincode::decode_from_slice(&data, BINCODE_CONFIG)
208+
bincode::serde::decode_from_slice(&data, BINCODE_CONFIG)
204209
.context("Failed to deserialize annotated_items")?
205210
.0
206211
} else {

rustdoc/rustdoc_processor/src/indexing/import_index.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use std::collections::BTreeSet;
66
use ahash::HashMap;
77

88
/// An index of all importable items in a crate.
9-
#[derive(
10-
Debug, Clone, Default, serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode,
11-
)]
9+
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
1210
pub struct ImportIndex {
1311
/// A mapping that keeps track of all modules defined in the current crate.
1412
///
@@ -24,9 +22,7 @@ pub struct ImportIndex {
2422
}
2523

2624
/// An entry in [`ImportIndex`].
27-
#[derive(
28-
Debug, Clone, Default, serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode,
29-
)]
25+
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
3026
pub struct ImportIndexEntry {
3127
/// All the public paths that can be used to import the item.
3228
pub public_paths: BTreeSet<SortablePath>,

0 commit comments

Comments
 (0)