diff --git a/Cargo.lock b/Cargo.lock index 03a4d71f67c3a..d9a16c81afa34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5358,8 +5358,7 @@ dependencies = [ [[package]] name = "stringdex" version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556a6126952cb2f5150057c98a77cc6c771027dea2825bf7fa03d3d638b0a4f8" +source = "git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514" dependencies = [ "stacker", ] diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index 0bc38220614f1..f30b4b7593e60 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -21,7 +21,7 @@ rustdoc-json-types = { path = "../rustdoc-json-types" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" smallvec = "1.8.1" -stringdex = "=0.0.3" +stringdex = { git = "https://gitlab.com/notriddle/stringdex", rev = "563240a4ffa22b57db94eda48a94652925a4f514" } tempfile = "3" threadpool = "1.8.1" tracing = "0.1" diff --git a/src/librustdoc/html/static/js/stringdex.js b/src/librustdoc/html/static/js/stringdex.js index 2a73ae50e720d..5501723c467a5 100644 --- a/src/librustdoc/html/static/js/stringdex.js +++ b/src/librustdoc/html/static/js/stringdex.js @@ -54,6 +54,23 @@ class RoaringBitmap { } this.consumed_len_bytes = pspecial - i; return this; + } else if (u8array[i] > 0xe0) { + // Special representation of tiny sets that are runs + const lspecial = u8array[i] & 0x0f; + this.keysAndCardinalities = new Uint8Array(lspecial * 4); + i += 1; + const key = u8array[i + 2] | (u8array[i + 3] << 8); + const value = u8array[i] | (u8array[i + 1] << 8); + const container = new RoaringBitmapRun(1, new Uint8Array(4)); + container.array[0] = value & 0xFF; + container.array[1] = (value >> 8) & 0xFF; + container.array[2] = lspecial - 1; + this.containers.push(container); + this.keysAndCardinalities[0] = key & 0xFF; + this.keysAndCardinalities[1] = (key >> 8) & 0xFF; + this.keysAndCardinalities[2] = lspecial - 1; + this.consumed_len_bytes = 5; + return this; } else if (u8array[i] < 0x3a) { // Special representation of tiny sets with arbitrary 32-bit integers const lspecial = u8array[i]; @@ -2282,7 +2299,7 @@ function loadDatabase(hooks) { */ class InlineNeighborsTree { /** - * @param {Uint8Array} encoded + * @param {Uint8Array} encoded * @param {number} start */ constructor( @@ -2654,7 +2671,7 @@ function loadDatabase(hooks) { /** * @param {string} inputBase64 - * @returns {[Uint8Array, SearchTree]} + * @returns {[Uint8Array, SearchTree]} */ function makeSearchTreeFromBase64(inputBase64) { const input = makeUint8ArrayFromBase64(inputBase64); @@ -3305,7 +3322,7 @@ if (typeof window !== "undefined") { // eslint-disable-next-line max-len // polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64 /** - * @type {function(string): Uint8Array} base64 + * @type {function(string): Uint8Array} base64 */ //@ts-expect-error const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 : (string => { @@ -3318,7 +3335,7 @@ const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 : return bytes; }); /** - * @type {function(string): Uint8Array} base64 + * @type {function(string): Uint8Array} base64 */ //@ts-expect-error const makeUint8ArrayFromHex = Uint8Array.fromHex ? Uint8Array.fromHex : (string => { diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index 19c773d12f7fa..81de72dc67556 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -11,6 +11,8 @@ const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, // This is `rust_team_data` used by `site` in src/tools/rustc-perf, r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#, + // TMP + r#""git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514""#, ]; /// Checks for external package sources. `root` is the path to the directory that contains the