From a58e21489424de9ce1fb48c2d4a7113dcd62f095 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Fri, 29 Oct 2021 20:57:12 -0700 Subject: [PATCH] rustdoc: Stop sorting external crates Now that #73423 is fixed, sorting should no longer be necessary. See also this discussion [1]. [1]: https://github.com/rust-lang/rust/pull/86889#discussion_r664134963 --- src/librustdoc/clean/utils.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index b0da92081c1..2fae3163a1a 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -29,12 +29,11 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate { let module = crate::visit_ast::RustdocVisitor::new(cx).visit(); let mut externs = Vec::new(); - for &cnum in cx.tcx.crates(()).iter() { + for &cnum in cx.tcx.crates(()) { externs.push(ExternalCrate { crate_num: cnum }); // Analyze doc-reachability for extern items LibEmbargoVisitor::new(cx).visit_lib(cnum); } - externs.sort_unstable_by_key(|e| e.crate_num); // Clean the crate, translating the entire librustc_ast AST to one that is // understood by rustdoc.