]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/read-more-unneeded.rs
Auto merge of #107529 - Zoxc:inline-tweak-profile, r=cjgillot
[rust.git] / tests / rustdoc / read-more-unneeded.rs
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 }