File tree 2 files changed +34
-2
lines changed
2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Regression test for https://github.com/rust-lang/rust/issues/105677.
2
+ // This test ensures that the "Read more" link is only generated when
3
+ // there is actually more documentation to read after the short summary.
4
+
5
+ #![ crate_name = "foo" ]
6
+
7
+ pub trait MyFrom {
8
+ /// # Hello
9
+ /// ## Yolo
10
+ /// more!
11
+ fn try_from1 ( ) ;
12
+ /// a
13
+ /// b
14
+ /// c
15
+ fn try_from2 ( ) ;
16
+ /// a
17
+ ///
18
+ /// b
19
+ ///
20
+ /// c
21
+ fn try_from3 ( ) ;
22
+ }
23
+
24
+ pub struct NonZero ;
25
+
26
+ // @has 'foo/struct.NonZero.html'
27
+ impl MyFrom for NonZero {
28
+ // @matches - '//*[@class="docblock"]' '^Hello Read more$'
29
+ fn try_from1 ( ) { }
30
+ // @matches - '//*[@class="docblock"]' '^a\sb\sc$'
31
+ fn try_from2 ( ) { }
32
+ // @matches - '//*[@class="docblock"]' '^a Read more$'
33
+ fn try_from3 ( ) { }
34
+ }
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ impl Trait for Struct {
30
30
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]' 'These docs contain'
31
31
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'reference link'
32
32
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'https://example.com'
33
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'Read more'
34
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.b'
35
33
fn b ( ) { }
36
34
37
35
// @!has - '//*[@id="method.c"]/../../div[@class="docblock"]' 'code block'
You can’t perform that action at this time.
0 commit comments