File tree 2 files changed +35
-2
lines changed
2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -2588,7 +2588,8 @@ fn render_assoc_item(w: &mut fmt::Formatter,
2588
2588
href ( did) . map ( |p| format ! ( "{}#{}.{}" , p. 0 , ty, name) ) . unwrap_or ( anchor)
2589
2589
}
2590
2590
} ;
2591
- let mut head_len = format ! ( "{}{}{:#}fn {}{:#}" ,
2591
+ let mut head_len = format ! ( "{}{}{}{:#}fn {}{:#}" ,
2592
+ VisSpace ( & meth. visibility) ,
2592
2593
ConstnessSpace ( constness) ,
2593
2594
UnsafetySpace ( unsafety) ,
2594
2595
AbiSpace ( abi) ,
@@ -2600,8 +2601,9 @@ fn render_assoc_item(w: &mut fmt::Formatter,
2600
2601
} else {
2601
2602
( 0 , true )
2602
2603
} ;
2603
- write ! ( w, "{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2604
+ write ! ( w, "{}{}{}{} fn <a href='{href}' class='fnname'>{name}</a>\
2604
2605
{generics}{decl}{where_clause}",
2606
+ VisSpace ( & meth. visibility) ,
2605
2607
ConstnessSpace ( constness) ,
2606
2608
UnsafetySpace ( unsafety) ,
2607
2609
AbiSpace ( abi) ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // ignore-tidy-linelength
12
+ // compile-flags: --no-defaults --passes collapse-docs --passes unindent-comments --passes strip-priv-imports
13
+
14
+ #![ crate_name = "foo" ]
15
+
16
+ // @has foo/fn.bar.html
17
+ // @has - '//*[@class="rust fn"]' 'pub fn bar() -> '
18
+ /// foo
19
+ pub fn bar ( ) -> usize {
20
+ 2
21
+ }
22
+
23
+ // @has foo/struct.Foo.html
24
+ // @has - '//*[@class="method"]' 'pub fn new()'
25
+ // @has - '//*[@class="method"]' 'fn not_pub()'
26
+ pub struct Foo ( usize ) ;
27
+
28
+ impl Foo {
29
+ pub fn new ( ) -> Foo { Foo ( 0 ) }
30
+ fn not_pub ( ) { }
31
+ }
You can’t perform that action at this time.
0 commit comments