From ba00bb4af9648fa1c52c17ea3b8d087206d960e6 Mon Sep 17 00:00:00 2001 From: Fisher Darling Date: Thu, 10 Dec 2020 12:42:04 -0700 Subject: Sort impls by trait definition Closes #6110 --- crates/assists/src/tests/generated.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'crates/assists/src/tests/generated.rs') diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index e28837b53..217f577eb 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs @@ -895,6 +895,41 @@ const test: Foo = Foo {foo: 1, bar: 0} ) } +#[test] +fn doctest_reorder_impl() { + check_doc_test( + "reorder_impl", + r#####" +trait Foo { + fn a() {} + fn b() {} + fn c() {} +} + +struct Bar; +$0impl Foo for Bar { + fn b() {} + fn c() {} + fn a() {} +} +"#####, + r#####" +trait Foo { + fn a() {} + fn b() {} + fn c() {} +} + +struct Bar; +impl Foo for Bar { + fn a() {} + fn b() {} + fn c() {} +} +"#####, + ) +} + #[test] fn doctest_replace_derive_with_manual_impl() { check_doc_test( -- cgit v1.2.3