Skip to content

Commit e9fec86

Browse files
committed
Check index version for bindeps
1 parent 3e30921 commit e9fec86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cargo/sources/registry/index.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ impl<'cfg> RegistryIndex<'cfg> {
291291
where
292292
'a: 'b,
293293
{
294+
let bindeps = self.config.cli_unstable().bindeps;
295+
294296
let source_id = self.source_id;
295297
let config = self.config;
296298

@@ -322,6 +324,9 @@ impl<'cfg> RegistryIndex<'cfg> {
322324
},
323325
)
324326
.filter(move |is| {
327+
if is.v == 3 && bindeps {
328+
return true;
329+
}
325330
if is.v > INDEX_V_MAX {
326331
debug!(
327332
"unsupported schema version {} ({} {})",
@@ -714,7 +719,7 @@ impl<'a> SummariesCache<'a> {
714719
.get(..4)
715720
.ok_or_else(|| anyhow::anyhow!("cache expected 4 bytes for index version"))?;
716721
let index_v = u32::from_le_bytes(index_v_bytes.try_into().unwrap());
717-
if index_v != INDEX_V_MAX {
722+
if index_v != INDEX_V_MAX && index_v != 3 {
718723
bail!(
719724
"index format version {} doesn't match the version I know ({})",
720725
index_v,

0 commit comments

Comments
 (0)