File tree 2 files changed +43
-2
lines changed
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 {
2245
2245
fn no_skip_default_2() -> Option<()> {
2246
2246
todo!()
2247
2247
}
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
+ }
2248
2279
}
2249
2280
"# ,
2250
2281
)
Original file line number Diff line number Diff line change @@ -106,8 +106,18 @@ pub fn filter_assoc_items(
106
106
. iter ( )
107
107
. copied ( )
108
108
. 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 ;
111
121
} )
112
122
// Note: This throws away items with no source.
113
123
. filter_map ( |assoc_item| {
You can’t perform that action at this time.
0 commit comments