File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 1+ #![ crate_name = "bar" ]
2+
3+ pub struct Ref < ' a > ( & ' a u32 ) ;
4+
5+ pub fn test5 ( a : & u32 ) -> Ref {
6+ Ref ( a)
7+ }
8+
9+ pub fn test6 ( a : & u32 ) -> Ref < ' _ > {
10+ Ref ( a)
11+ }
Original file line number Diff line number Diff line change 1- #! [ crate_name = "foo" ]
2-
1+ // aux-build:elided-lifetime.rs
2+ //
33// rust-lang/rust#75225
44//
55// Since Rust 2018 we encourage writing out <'_> explicitly to make it clear
66// that borrowing is occuring. Make sure rustdoc is following the same idiom.
77
8+ #![ crate_name = "foo" ]
9+
810pub struct Ref < ' a > ( & ' a u32 ) ;
911type ARef < ' a > = Ref < ' a > ;
1012
@@ -32,15 +34,10 @@ pub fn test4(a: &u32) -> ARef<'_> {
3234 Ref ( a)
3335}
3436
35- // Ensure external paths also display elided lifetime
36- // @has foo/fn.test5.html
37- // @matches - "Iter</a><'_"
38- pub fn test5 ( a : & Option < u32 > ) -> std:: option:: Iter < u32 > {
39- a. iter ( )
40- }
41-
42- // @has foo/fn.test6.html
43- // @matches - "Iter</a><'_"
44- pub fn test6 ( a : & Option < u32 > ) -> std:: option:: Iter < ' _ , u32 > {
45- a. iter ( )
46- }
37+ // Ensure external paths in inlined docs also display elided lifetime
38+ // @has foo/bar/fn.test5.html
39+ // @matches - "Ref</a><'_>"
40+ // @has foo/bar/fn.test6.html
41+ // @matches - "Ref</a><'_>"
42+ #[ doc( inline) ]
43+ pub extern crate bar;
You can’t perform that action at this time.
0 commit comments