File tree Expand file tree Collapse file tree 4 files changed +56
-9
lines changed Expand file tree Collapse file tree 4 files changed +56
-9
lines changed Original file line number Diff line number Diff line change @@ -168,18 +168,17 @@ impl<'tcx> Context<'tcx> {
168168 }
169169
170170 fn render_item ( & self , it : & clean:: Item , pushname : bool ) -> String {
171- let mut title = if it. is_primitive ( ) || it. is_keyword ( ) {
172- // No need to include the namespace for primitive types and keywords
173- String :: new ( )
174- } else {
175- self . current . join ( "::" )
176- } ;
171+ let mut title = String :: new ( ) ;
177172 if pushname {
178- if !title. is_empty ( ) {
179- title. push_str ( "::" ) ;
180- }
181173 title. push_str ( & it. name . unwrap ( ) . as_str ( ) ) ;
182174 }
175+ if !it. is_primitive ( ) && !it. is_keyword ( ) {
176+ if pushname {
177+ title. push_str ( " in " ) ;
178+ }
179+ // No need to include the namespace for primitive types and keywords
180+ title. push_str ( & self . current . join ( "::" ) ) ;
181+ } ;
183182 title. push_str ( " - Rust" ) ;
184183 let tyname = it. type_ ( ) ;
185184 let desc = it. doc_value ( ) . as_ref ( ) . map ( |doc| plain_text_summary ( & doc) ) ;
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+
3+ // @has foo/index.html '//head/title' 'foo - Rust'
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+ #![ feature( doc_keyword) ]
3+
4+ // @has foo/fn.widget_count.html '//head/title' 'widget_count in foo - Rust'
5+ /// blah
6+ pub fn widget_count ( ) { }
7+
8+ // @has foo/struct.Widget.html '//head/title' 'Widget in foo - Rust'
9+ pub struct Widget ;
10+
11+ // @has foo/constant.ANSWER.html '//head/title' 'ANSWER in foo - Rust'
12+ pub const ANSWER : u8 = 42 ;
13+
14+ pub mod blah {
15+ // @has foo/blah/struct.Widget.html '//head/title' 'Widget in foo::blah - Rust'
16+ pub struct Widget ;
17+
18+ // @has foo/blah/trait.Awesome.html '//head/title' 'Awesome in foo::blah - Rust'
19+ pub trait Awesome { }
20+
21+ // @has foo/blah/fn.make_widget.html '//head/title' 'make_widget in foo::blah - Rust'
22+ pub fn make_widget ( ) { }
23+
24+ // @has foo/macro.cool_macro.html '//head/title' 'cool_macro in foo - Rust'
25+ #[ macro_export]
26+ macro_rules! cool_macro {
27+ ( $t: tt) => { $t }
28+ }
29+ }
30+
31+ // @has foo/keyword.continue.html '//head/title' 'continue - Rust'
32+ #[ doc( keyword = "continue" ) ]
33+ mod continue_keyword { }
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+
3+ // @has foo/bar/index.html '//head/title' 'foo::bar - Rust'
4+ /// blah
5+ pub mod bar {
6+ pub fn a ( ) { }
7+ }
8+
9+ // @has foo/baz/index.html '//head/title' 'foo::baz - Rust'
10+ pub mod baz {
11+ pub fn a ( ) { }
12+ }
You can’t perform that action at this time.
0 commit comments