We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
kw::Empty
1 parent 5fb0f57 commit 4097858Copy full SHA for 4097858
src/librustdoc/html/render/print_item.rs
@@ -11,7 +11,7 @@ use rustc_hir::def_id::DefId;
11
use rustc_index::IndexVec;
12
use rustc_middle::ty::{self, TyCtxt};
13
use rustc_span::hygiene::MacroKind;
14
-use rustc_span::symbol::{Symbol, kw, sym};
+use rustc_span::symbol::{Symbol, sym};
15
use tracing::{debug, info};
16
17
use super::type_layout::document_type_layout;
@@ -347,9 +347,12 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i
347
// but we actually want stable items to come first
348
return is_stable2.cmp(&is_stable1);
349
}
350
- let lhs = i1.name.unwrap_or(kw::Empty);
351
- let rhs = i2.name.unwrap_or(kw::Empty);
352
- compare_names(lhs.as_str(), rhs.as_str())
+ match (i1.name, i2.name) {
+ (Some(name1), Some(name2)) => compare_names(name1.as_str(), name2.as_str()),
+ (Some(_), None) => Ordering::Greater,
353
+ (None, Some(_)) => Ordering::Less,
354
+ (None, None) => Ordering::Equal,
355
+ }
356
357
358
let tcx = cx.tcx();
0 commit comments