Skip to content

Commit 40c4f6d

Browse files
committed
Auto merge of #148179 - cuviper:stable-next, r=cuviper
[stable] Prepare Rust 1.91.0 release - [beta-1.91] Add more context to the temporary lifetime extension FCW #148174 - rustdoc-search: JavaScript optimization based on Firefox Profiler output #146484 - rustdoc-search: use the same ID for entry and path to same item #147045 - rustdoc-search: stringdex update with more packing #147002 - rustdoc-search: stringdex 0.0.2 #147660 - [beta] Clippy beta backport #148029 - 1.91.0 release notes #148013 r? cuviper
2 parents f2f881b + be999ad commit 40c4f6d

File tree

16 files changed

+1060
-219
lines changed

16 files changed

+1060
-219
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5216,9 +5216,9 @@ dependencies = [
52165216

52175217
[[package]]
52185218
name = "stringdex"
5219-
version = "0.0.1-alpha9"
5219+
version = "0.0.2"
52205220
source = "registry+https://github.com/rust-lang/crates.io-index"
5221-
checksum = "7081029913fd7d591c0112182aba8c98ae886b4f12edb208130496cd17dc3c15"
5221+
checksum = "18b3bd4f10d15ef859c40291769f0d85209de6b0f1c30713ff9cdf45ac43ea36"
52225222
dependencies = [
52235223
"stacker",
52245224
]

RELEASES.md

Lines changed: 337 additions & 0 deletions
Large diffs are not rendered by default.

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
16071607
tcx.node_span_lint(MACRO_EXTENDED_TEMPORARY_SCOPES, lint_root, labels, |diag| {
16081608
diag.primary_message("temporary lifetime will be shortened in Rust 1.92");
16091609
diag.note("consider using a `let` binding to create a longer lived value");
1610+
diag.note("some temporaries were previously incorrectly lifetime-extended since Rust 1.89 in formatting macros, and since Rust 1.88 in `pin!()`");
16101611
});
16111612
}
16121613
}

src/ci/channel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beta
1+
stable

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rustdoc-json-types = { path = "../rustdoc-json-types" }
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
2323
smallvec = "1.8.1"
24-
stringdex = { version = "0.0.1-alpha9" }
24+
stringdex = "=0.0.2"
2525
tempfile = "3"
2626
threadpool = "1.8.1"
2727
tracing = "0.1"

src/librustdoc/html/render/search_index.rs

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,34 @@ impl SerializedSearchIndex {
239239
self.alias_pointers.push(alias_pointer);
240240
index
241241
}
242+
/// Add potential search result to the database and return the row ID.
243+
///
244+
/// The returned ID can be used to attach more data to the search result.
245+
fn add_entry(&mut self, name: Symbol, entry_data: EntryData, desc: String) -> usize {
246+
let fqp = if let Some(module_path_index) = entry_data.module_path {
247+
let mut fqp = self.path_data[module_path_index].as_ref().unwrap().module_path.clone();
248+
fqp.push(Symbol::intern(&self.names[module_path_index]));
249+
fqp.push(name);
250+
fqp
251+
} else {
252+
vec![name]
253+
};
254+
// If a path with the same name already exists, but no entry does,
255+
// we can fill in the entry without having to allocate a new row ID.
256+
//
257+
// Because paths and entries both share the same index, using the same
258+
// ID saves space by making the tree smaller.
259+
if let Some(&other_path) = self.crate_paths_index.get(&(entry_data.ty, fqp))
260+
&& self.entry_data[other_path].is_none()
261+
&& self.descs[other_path].is_empty()
262+
{
263+
self.entry_data[other_path] = Some(entry_data);
264+
self.descs[other_path] = desc;
265+
other_path
266+
} else {
267+
self.push(name.as_str().to_string(), None, Some(entry_data), desc, None, None, None)
268+
}
269+
}
242270
fn push_path(&mut self, name: String, path_data: PathData) -> usize {
243271
self.push(name, Some(path_data), None, String::new(), None, None, None)
244272
}
@@ -1513,10 +1541,9 @@ pub(crate) fn build_index(
15131541
.as_ref()
15141542
.map(|path| serialized_index.get_id_by_module_path(path));
15151543

1516-
let new_entry_id = serialized_index.push(
1517-
item.name.as_str().to_string(),
1518-
None,
1519-
Some(EntryData {
1544+
let new_entry_id = serialized_index.add_entry(
1545+
item.name,
1546+
EntryData {
15201547
ty: item.ty,
15211548
parent: item.parent_idx,
15221549
module_path,
@@ -1535,11 +1562,8 @@ pub(crate) fn build_index(
15351562
None
15361563
},
15371564
krate: crate_idx,
1538-
}),
1565+
},
15391566
item.desc.to_string(),
1540-
None, // filled in after all the types have been indexed
1541-
None,
1542-
None,
15431567
);
15441568

15451569
// Aliases

src/librustdoc/html/static/js/rustdoc.d.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ declare namespace rustdoc {
348348
returned: rustdoc.QueryElement[],
349349
is_alias: boolean,
350350
alias?: string,
351-
original?: rustdoc.Rlow,
351+
item: rustdoc.Row,
352352
}
353353

354354
/**
@@ -533,4 +533,27 @@ declare namespace rustdoc {
533533
* Generated by `render_call_locations` in `render/mod.rs`.
534534
*/
535535
type ScrapedLoc = [[number, number], string, string]
536+
537+
/**
538+
* Each of these identifiers are used specially by
539+
* type-driven search. Most of them are lang items
540+
* in the compiler.
541+
*/
542+
type TypeNameIds = {
543+
"typeNameIdOfOutput": number,
544+
"typeNameIdOfFnPtr": number,
545+
"typeNameIdOfFn": number,
546+
"typeNameIdOfFnMut": number,
547+
"typeNameIdOfFnOnce": number,
548+
"typeNameIdOfArray": number,
549+
"typeNameIdOfSlice": number,
550+
"typeNameIdOfArrayOrSlice": number,
551+
"typeNameIdOfTuple": number,
552+
"typeNameIdOfUnit": number,
553+
"typeNameIdOfTupleOrUnit": number,
554+
"typeNameIdOfReference": number,
555+
"typeNameIdOfPointer": number,
556+
"typeNameIdOfHof": number,
557+
"typeNameIdOfNever": number,
558+
};
536559
}

0 commit comments

Comments
 (0)