Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a2d03e7
coretests/num: use ldexp instead of hard-coding a power of 2
RalfJung Jul 21, 2025
bcaa795
removed tidy check on issues files
Kivooeo Jul 19, 2025
58537fb
Fix broken TLS destructors on 32-bit win7
roblabla Jul 20, 2025
b2f8b40
Don't ICE on non-TypeId metadata within TypeId
oli-obk Jul 21, 2025
6df15a1
update SUMMARY.md
makai410 Jul 16, 2025
551cb9f
mbe: Use concrete type for `get_unused_rule`
joshtriplett Jul 22, 2025
f877aa7
coverage: Enlarge empty spans during MIR instrumentation, not codegen
Zalathar May 4, 2025
2832517
Clean code for `rustc_parse/src/lexer`
xizheyin Jul 21, 2025
0aa6170
Add a test case for ui test false-sealed-traits-note.rs
yuk1ty Jul 21, 2025
f5a33e8
Add powerpc64le-unknown-linux-musl to CI rustc targets
Gelbpunkt Jul 22, 2025
25bbaf0
bootstrap: add package.json and package-lock.json to dist tarball
lolbinarycat Jul 22, 2025
9e75032
rustdoc: avoid allocating a temp String for aliases in search index
lolbinarycat Jul 22, 2025
1f14065
Rollup merge of #144173 - Kivooeo:tidy_checks, r=jieyouxu
GuillaumeGomez Jul 23, 2025
5636795
Rollup merge of #144234 - roblabla:fix-win7-tls-dtors, r=ChrisDenton
GuillaumeGomez Jul 23, 2025
a3e9041
Rollup merge of #144239 - xizheyin:clean-lexer, r=fee1-dead
GuillaumeGomez Jul 23, 2025
bfd744c
Rollup merge of #144240 - yuk1ty:false-sealed-traits-note-reported-in…
GuillaumeGomez Jul 23, 2025
609f531
Rollup merge of #144247 - RalfJung:ldexp, r=tgross35
GuillaumeGomez Jul 23, 2025
43857e3
Rollup merge of #144256 - oli-obk:type-id-ice, r=RalfJung
GuillaumeGomez Jul 23, 2025
d53e34b
Rollup merge of #144290 - makai410:summary-ups, r=jieyouxu
GuillaumeGomez Jul 23, 2025
0f54963
Rollup merge of #144292 - joshtriplett:mbe-use-concrete-type-for-get-…
GuillaumeGomez Jul 23, 2025
66624a5
Rollup merge of #144298 - Zalathar:empty-span, r=wesleywiser
GuillaumeGomez Jul 23, 2025
dc6267c
Rollup merge of #144311 - Gelbpunkt:ci-rustc-ppc64le-musl, r=Kobzol
GuillaumeGomez Jul 23, 2025
1e05e13
Rollup merge of #144315 - lolbinarycat:bootstrap-dist-package.json, r…
GuillaumeGomez Jul 23, 2025
9d4b42a
Rollup merge of #144320 - lolbinarycat:rustdoc-search_index-BTreeMap-…
GuillaumeGomez Jul 23, 2025
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
19 changes: 16 additions & 3 deletions src/librustdoc/html/render/search_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,22 @@ pub(crate) fn build_index(
let crate_doc =
short_markdown_summary(&krate.module.doc_value(), &krate.module.link_names(cache));

#[derive(Eq, Ord, PartialEq, PartialOrd)]
struct SerSymbolAsStr(Symbol);

impl Serialize for SerSymbolAsStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
self.0.as_str().serialize(serializer)
}
}

type AliasMap = BTreeMap<SerSymbolAsStr, Vec<usize>>;
// Aliases added through `#[doc(alias = "...")]`. Since a few items can have the same alias,
// we need the alias element to have an array of items.
let mut aliases: BTreeMap<String, Vec<usize>> = BTreeMap::new();
let mut aliases: AliasMap = BTreeMap::new();

// Sort search index items. This improves the compressibility of the search index.
cache.search_index.sort_unstable_by(|k1, k2| {
Expand All @@ -116,7 +129,7 @@ pub(crate) fn build_index(
// Set up alias indexes.
for (i, item) in cache.search_index.iter().enumerate() {
for alias in &item.aliases[..] {
aliases.entry(alias.to_string()).or_default().push(i);
aliases.entry(SerSymbolAsStr(*alias)).or_default().push(i);
}
}

Expand Down Expand Up @@ -474,7 +487,7 @@ pub(crate) fn build_index(
// The String is alias name and the vec is the list of the elements with this alias.
//
// To be noted: the `usize` elements are indexes to `items`.
aliases: &'a BTreeMap<String, Vec<usize>>,
aliases: &'a AliasMap,
// Used when a type has more than one impl with an associated item with the same name.
associated_item_disambiguators: &'a Vec<(usize, String)>,
// A list of shard lengths encoded as vlqhex. See the comment in write_vlqhex_to_string
Expand Down
Loading