File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -2621,7 +2621,8 @@ fn render_assoc_item(w: &mut fmt::Formatter,
2621
2621
href ( did) . map ( |p| format ! ( "{}#{}.{}" , p. 0 , ty, name) ) . unwrap_or ( anchor)
2622
2622
}
2623
2623
} ;
2624
- let mut head_len = format ! ( "{}{}{:#}fn {}{:#}" ,
2624
+ let mut head_len = format ! ( "{}{}{}{:#}fn {}{:#}" ,
2625
+ VisSpace ( & meth. visibility) ,
2625
2626
ConstnessSpace ( constness) ,
2626
2627
UnsafetySpace ( unsafety) ,
2627
2628
AbiSpace ( abi) ,
@@ -2633,8 +2634,9 @@ fn render_assoc_item(w: &mut fmt::Formatter,
2633
2634
} else {
2634
2635
( 0 , true )
2635
2636
} ;
2636
- write ! ( w, "{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2637
+ write ! ( w, "{}{}{}{} fn <a href='{href}' class='fnname'>{name}</a>\
2637
2638
{generics}{decl}{where_clause}",
2639
+ VisSpace ( & meth. visibility) ,
2638
2640
ConstnessSpace ( constness) ,
2639
2641
UnsafetySpace ( unsafety) ,
2640
2642
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