From 2e4a36bb530096537ce5a72d18c4b8dd4ea2a97b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 2 Nov 2023 18:01:28 +0100 Subject: Add GUI test to ensure that implementations on foreign types are in the expected order --- tests/rustdoc-gui/src/test_docs/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/rustdoc-gui/src/test_docs') 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 { + 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]) {} + } +} -- cgit 1.4.1-3-g733a5