This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -2245,6 +2245,37 @@ impl b::LocalTrait for B {
22452245 fn no_skip_default_2() -> Option<()> {
22462246 todo!()
22472247 }
2248+ }
2249+ "# ,
2250+ )
2251+ }
2252+
2253+ #[ test]
2254+ fn doc_hidden_nondefault_member ( ) {
2255+ check_assist (
2256+ add_missing_impl_members,
2257+ r#"
2258+ //- /lib.rs crate:b new_source_root:local
2259+ trait LocalTrait {
2260+ #[doc(hidden)]
2261+ fn no_skip_non_default() -> Option<()>;
2262+
2263+ #[doc(hidden)]
2264+ fn skip_default() -> Option<()> {
2265+ todo!()
2266+ }
2267+ }
2268+
2269+ //- /main.rs crate:a deps:b
2270+ struct B;
2271+ impl b::Loc$0alTrait for B {}
2272+ "# ,
2273+ r#"
2274+ struct B;
2275+ impl b::LocalTrait for B {
2276+ fn no_skip_non_default() -> Option<()> {
2277+ ${0:todo!()}
2278+ }
22482279}
22492280 "# ,
22502281 )
Original file line number Diff line number Diff line change @@ -106,8 +106,18 @@ pub fn filter_assoc_items(
106106 . iter ( )
107107 . copied ( )
108108 . filter ( |assoc_item| {
109- !( ignore_items == IgnoreAssocItems :: DocHiddenAttrPresent
110- && assoc_item. attrs ( sema. db ) . has_doc_hidden ( ) )
109+ if ignore_items == IgnoreAssocItems :: DocHiddenAttrPresent
110+ && assoc_item. attrs ( sema. db ) . has_doc_hidden ( )
111+ {
112+ if let hir:: AssocItem :: Function ( f) = assoc_item {
113+ if !f. has_body ( sema. db ) {
114+ return true ;
115+ }
116+ }
117+ return false ;
118+ }
119+
120+ return true ;
111121 } )
112122 // Note: This throws away items with no source.
113123 . filter_map ( |assoc_item| {
You can’t perform that action at this time.
0 commit comments