File tree 2 files changed +22
-14
lines changed
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
+ //
3
3
// rust-lang/rust#75225
4
4
//
5
5
// Since Rust 2018 we encourage writing out <'_> explicitly to make it clear
6
6
// that borrowing is occuring. Make sure rustdoc is following the same idiom.
7
7
8
+ #![ crate_name = "foo" ]
9
+
8
10
pub struct Ref < ' a > ( & ' a u32 ) ;
9
11
type ARef < ' a > = Ref < ' a > ;
10
12
@@ -32,15 +34,10 @@ pub fn test4(a: &u32) -> ARef<'_> {
32
34
Ref ( a)
33
35
}
34
36
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