about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-11-02 18:00:57 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-11-02 18:02:14 +0100
commitaa9d1d87fa85971f9073f0f2cde531ea5819aa3a (patch)
tree1d100e9a894eb109de94b6e00196d25eadbb8d39 /src/librustdoc/html/render
parent11cd1f00268061dff447bc0df3d679b35d460875 (diff)
downloadrust-aa9d1d87fa85971f9073f0f2cde531ea5819aa3a.tar.gz
rust-aa9d1d87fa85971f9073f0f2cde531ea5819aa3a.zip
Fix order of implementations in the "implementations on foreign types" section
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 65e7c08d521..d226701ba4a 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -991,7 +991,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
             }
         }
 
-        let (local, foreign) =
+        let (local, mut foreign) =
             implementors.iter().partition::<Vec<_>, _>(|i| i.is_on_local_type(cx));
 
         let (mut synthetic, mut concrete): (Vec<&&Impl>, Vec<&&Impl>) =
@@ -999,6 +999,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
 
         synthetic.sort_by_cached_key(|i| ImplString::new(i, cx));
         concrete.sort_by_cached_key(|i| ImplString::new(i, cx));
+        foreign.sort_by_cached_key(|i| ImplString::new(i, cx));
 
         if !foreign.is_empty() {
             write_small_section_header(w, "foreign-impls", "Implementations on Foreign Types", "");