about summary refs log tree commit diff
path: root/tests/rustdoc-gui/src/test_docs/lib.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-11-02 18:01:28 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-11-02 18:02:14 +0100
commit2e4a36bb530096537ce5a72d18c4b8dd4ea2a97b (patch)
treed1d0e47e22c995487d7e6df95c0cb50499d38fc9 /tests/rustdoc-gui/src/test_docs/lib.rs
parentaa9d1d87fa85971f9073f0f2cde531ea5819aa3a (diff)
downloadrust-2e4a36bb530096537ce5a72d18c4b8dd4ea2a97b.tar.gz
rust-2e4a36bb530096537ce5a72d18c4b8dd4ea2a97b.zip
Add GUI test to ensure that implementations on foreign types are in the expected order
Diffstat (limited to 'tests/rustdoc-gui/src/test_docs/lib.rs')
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index 138a1b302fd..c7d115bdb98 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -574,3 +574,22 @@ impl ZyxwvutTrait for ZyxwvutMethodDisambiguation {
         x
     }
 }
+
+pub mod foreign_impl_order {
+    pub trait Foo<const W: usize> {
+        fn f(&mut self, with: [u8; W]);
+    }
+
+    impl Foo<4> for [u8; 4] {
+        fn f(&mut self, fg: [u8; 4]) {}
+    }
+    impl Foo<2> for [u8; 2] {
+        fn f(&mut self, fg: [u8; 2]) {}
+    }
+    impl Foo<1> for [u8; 1] {
+        fn f(&mut self, fg: [u8; 1]) {}
+    }
+    impl Foo<3> for [u8; 3] {
+        fn f(&mut self, fg: [u8; 3]) {}
+    }
+}