Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5216,9 +5216,9 @@ dependencies = [

[[package]]
name = "stringdex"
version = "0.0.1-alpha9"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7081029913fd7d591c0112182aba8c98ae886b4f12edb208130496cd17dc3c15"
checksum = "18b3bd4f10d15ef859c40291769f0d85209de6b0f1c30713ff9cdf45ac43ea36"
dependencies = [
"stacker",
]
Expand Down
337 changes: 337 additions & 0 deletions RELEASES.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions compiler/rustc_borrowck/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
tcx.node_span_lint(MACRO_EXTENDED_TEMPORARY_SCOPES, lint_root, labels, |diag| {
diag.primary_message("temporary lifetime will be shortened in Rust 1.92");
diag.note("consider using a `let` binding to create a longer lived value");
diag.note("some temporaries were previously incorrectly lifetime-extended since Rust 1.89 in formatting macros, and since Rust 1.88 in `pin!()`");
});
}
}
2 changes: 1 addition & 1 deletion src/ci/channel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
beta
stable
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 = { version = "0.0.1-alpha9" }
stringdex = "=0.0.2"
tempfile = "3"
threadpool = "1.8.1"
tracing = "0.1"
Expand Down
40 changes: 32 additions & 8 deletions src/librustdoc/html/render/search_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,34 @@ impl SerializedSearchIndex {
self.alias_pointers.push(alias_pointer);
index
}
/// Add potential search result to the database and return the row ID.
///
/// The returned ID can be used to attach more data to the search result.
fn add_entry(&mut self, name: Symbol, entry_data: EntryData, desc: String) -> usize {
let fqp = if let Some(module_path_index) = entry_data.module_path {
let mut fqp = self.path_data[module_path_index].as_ref().unwrap().module_path.clone();
fqp.push(Symbol::intern(&self.names[module_path_index]));
fqp.push(name);
fqp
} else {
vec![name]
};
// If a path with the same name already exists, but no entry does,
// we can fill in the entry without having to allocate a new row ID.
//
// Because paths and entries both share the same index, using the same
// ID saves space by making the tree smaller.
if let Some(&other_path) = self.crate_paths_index.get(&(entry_data.ty, fqp))
&& self.entry_data[other_path].is_none()
&& self.descs[other_path].is_empty()
{
self.entry_data[other_path] = Some(entry_data);
self.descs[other_path] = desc;
other_path
} else {
self.push(name.as_str().to_string(), None, Some(entry_data), desc, None, None, None)
}
}
fn push_path(&mut self, name: String, path_data: PathData) -> usize {
self.push(name, Some(path_data), None, String::new(), None, None, None)
}
Expand Down Expand Up @@ -1513,10 +1541,9 @@ pub(crate) fn build_index(
.as_ref()
.map(|path| serialized_index.get_id_by_module_path(path));

let new_entry_id = serialized_index.push(
item.name.as_str().to_string(),
None,
Some(EntryData {
let new_entry_id = serialized_index.add_entry(
item.name,
EntryData {
ty: item.ty,
parent: item.parent_idx,
module_path,
Expand All @@ -1535,11 +1562,8 @@ pub(crate) fn build_index(
None
},
krate: crate_idx,
}),
},
item.desc.to_string(),
None, // filled in after all the types have been indexed
None,
None,
);

// Aliases
Expand Down
25 changes: 24 additions & 1 deletion src/librustdoc/html/static/js/rustdoc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ declare namespace rustdoc {
returned: rustdoc.QueryElement[],
is_alias: boolean,
alias?: string,
original?: rustdoc.Rlow,
item: rustdoc.Row,
}

/**
Expand Down Expand Up @@ -533,4 +533,27 @@ declare namespace rustdoc {
* Generated by `render_call_locations` in `render/mod.rs`.
*/
type ScrapedLoc = [[number, number], string, string]

/**
* Each of these identifiers are used specially by
* type-driven search. Most of them are lang items
* in the compiler.
*/
type TypeNameIds = {
"typeNameIdOfOutput": number,
"typeNameIdOfFnPtr": number,
"typeNameIdOfFn": number,
"typeNameIdOfFnMut": number,
"typeNameIdOfFnOnce": number,
"typeNameIdOfArray": number,
"typeNameIdOfSlice": number,
"typeNameIdOfArrayOrSlice": number,
"typeNameIdOfTuple": number,
"typeNameIdOfUnit": number,
"typeNameIdOfTupleOrUnit": number,
"typeNameIdOfReference": number,
"typeNameIdOfPointer": number,
"typeNameIdOfHof": number,
"typeNameIdOfNever": number,
};
}
Loading
Loading