File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 5cff7c093eec13405ad8f6d16019c3b11cf88eac
2
+ refs/heads/master: a7d3544d10e1fd44fd3e3d300e7c56917ed4a305
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ fn fold_fn(
44
44
fold : fold:: fold < ctxt > ,
45
45
doc : doc:: fndoc
46
46
) -> doc:: fndoc {
47
+ let have_arg_docs = false ;
47
48
let doc = ~{
48
49
args: vec:: filter_map ( doc. args ) { |doc|
49
50
if option:: is_some ( doc. desc ) {
51
+ have_arg_docs = true ;
50
52
some ( doc)
51
53
} else {
52
54
none
@@ -58,6 +60,7 @@ fn fold_fn(
58
60
fold. ctxt . have_docs =
59
61
doc. brief != none
60
62
|| doc. desc != none
63
+ || have_arg_docs
61
64
|| doc. return . desc != none;
62
65
ret doc;
63
66
}
@@ -72,6 +75,16 @@ fn should_elide_undocumented_arguments() {
72
75
assert vec:: is_empty ( doc. topmod . fns [ 0 ] . args ) ;
73
76
}
74
77
78
+ #[ test]
79
+ fn should_not_elide_fns_with_documented_arguments ( ) {
80
+ let source = "#[doc(args(a = \" b\" ))] fn a(a: int) { }" ;
81
+ let srv = astsrv:: mk_srv_from_str ( source) ;
82
+ let doc = extract:: from_srv ( srv, "" ) ;
83
+ let doc = attr_pass:: mk_pass ( ) ( srv, doc) ;
84
+ let doc = run ( srv, doc) ;
85
+ assert vec:: is_not_empty ( * doc. topmod . fns ) ;
86
+ }
87
+
75
88
fn fold_modlist (
76
89
fold : fold:: fold < ctxt > ,
77
90
list : doc:: modlist
You can’t perform that action at this time.
0 commit comments