Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
25 changes: 21 additions & 4 deletions src/librustdoc/html/static/js/stringdex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -2282,7 +2299,7 @@ function loadDatabase(hooks) {
*/
class InlineNeighborsTree {
/**
* @param {Uint8Array<ArrayBuffer>} encoded
* @param {Uint8Array} encoded
* @param {number} start
*/
constructor(
Expand Down Expand Up @@ -2654,7 +2671,7 @@ function loadDatabase(hooks) {

/**
* @param {string} inputBase64
* @returns {[Uint8Array<ArrayBuffer>, SearchTree]}
* @returns {[Uint8Array, SearchTree]}
*/
function makeSearchTreeFromBase64(inputBase64) {
const input = makeUint8ArrayFromBase64(inputBase64);
Expand Down Expand Up @@ -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<ArrayBuffer>} base64
* @type {function(string): Uint8Array} base64
*/
//@ts-expect-error
const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 : (string => {
Expand All @@ -3318,7 +3335,7 @@ const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 :
return bytes;
});
/**
* @type {function(string): Uint8Array<ArrayBuffer>} base64
* @type {function(string): Uint8Array} base64
*/
//@ts-expect-error
const makeUint8ArrayFromHex = Uint8Array.fromHex ? Uint8Array.fromHex : (string => {
Expand Down
2 changes: 2 additions & 0 deletions src/tools/tidy/src/extdeps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading