]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/deprecated-impls.rs
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / rustdoc / deprecated-impls.rs
1 #![crate_name = "foo"]
2
3 // @has foo/struct.Foo0.html
4 pub struct Foo0;
5
6 impl Foo0 {
7     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
8     // @hasraw - 'fn_with_doc short'
9     // @hasraw - 'fn_with_doc full'
10     /// fn_with_doc short
11     ///
12     /// fn_with_doc full
13     #[deprecated(since = "1.0.1", note = "fn_with_doc")]
14     pub fn fn_with_doc() {}
15
16     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc'
17     #[deprecated(since = "1.0.2", note = "fn_without_doc")]
18     pub fn fn_without_doc() {}
19 }
20
21 pub trait Bar {
22     /// fn_empty_with_doc short
23     ///
24     /// fn_empty_with_doc full
25     #[deprecated(since = "1.0.3", note = "fn_empty_with_doc")]
26     fn fn_empty_with_doc();
27
28     #[deprecated(since = "1.0.4", note = "fn_empty_without_doc")]
29     fn fn_empty_without_doc();
30
31     /// fn_def_with_doc short
32     ///
33     /// fn_def_with_doc full
34     #[deprecated(since = "1.0.5", note = "fn_def_with_doc")]
35     fn fn_def_with_doc() {}
36
37     #[deprecated(since = "1.0.6", note = "fn_def_without_doc")]
38     fn fn_def_without_doc() {}
39
40     /// fn_def_def_with_doc short
41     ///
42     /// fn_def_def_with_doc full
43     #[deprecated(since = "1.0.7", note = "fn_def_def_with_doc")]
44     fn fn_def_def_with_doc() {}
45
46     #[deprecated(since = "1.0.8", note = "fn_def_def_without_doc")]
47     fn fn_def_def_without_doc() {}
48 }
49
50 // @has foo/struct.Foo1.html
51 pub struct Foo1;
52
53 impl Bar for Foo1 {
54     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
55     // @hasraw - 'fn_empty_with_doc_impl short'
56     // @hasraw - 'fn_empty_with_doc_impl full'
57     /// fn_empty_with_doc_impl short
58     ///
59     /// fn_empty_with_doc_impl full
60     fn fn_empty_with_doc() {}
61
62     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
63     fn fn_empty_without_doc() {}
64
65     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
66     // @hasraw - 'fn_def_with_doc_impl short'
67     // @hasraw - 'fn_def_with_doc_impl full'
68     /// fn_def_with_doc_impl short
69     ///
70     /// fn_def_with_doc_impl full
71     fn fn_def_with_doc() {}
72
73     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
74     fn fn_def_without_doc() {}
75
76     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
77     // @hasraw - 'fn_def_def_with_doc short'
78     // @!hasraw - 'fn_def_def_with_doc full'
79
80     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
81 }
82
83 // @has foo/struct.Foo2.html
84 pub struct Foo2;
85
86 impl Bar for Foo2 {
87     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
88     // @hasraw - 'fn_empty_with_doc short'
89     // @!hasraw - 'fn_empty_with_doc full'
90     fn fn_empty_with_doc() {}
91
92     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
93     // @hasraw - 'fn_empty_without_doc_impl short'
94     // @hasraw - 'fn_empty_without_doc_impl full'
95     /// fn_empty_without_doc_impl short
96     ///
97     /// fn_empty_without_doc_impl full
98     fn fn_empty_without_doc() {}
99
100     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
101     // @hasraw - 'fn_def_with_doc short'
102     // @!hasraw - 'fn_def_with_doc full'
103     fn fn_def_with_doc() {}
104
105     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
106     // @hasraw - 'fn_def_without_doc_impl short'
107     // @hasraw - 'fn_def_without_doc_impl full'
108     /// fn_def_without_doc_impl short
109     ///
110     /// fn_def_without_doc_impl full
111     fn fn_def_without_doc() {}
112
113     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
114     // @hasraw - 'fn_def_def_with_doc short'
115     // @!hasraw - 'fn_def_def_with_doc full'
116
117     // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
118 }