]> git.lizzy.rs Git - rust.git/blob - src/test/pretty/doc-comments.rs
auto merge of #13112 : ktt3ja/rust/issue-13058, r=pnkfelix
[rust.git] / src / test / pretty / doc-comments.rs
1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // pp-exact
12
13 // some single-line non-doc comment
14
15 /// some single line outer-docs
16 fn a() { }
17
18 fn b() {
19     //! some single line inner-docs
20 }
21
22 //////////////////////////////////
23 // some single-line non-doc comment preceded by a separator
24
25 //////////////////////////////////
26 /// some single-line outer-docs preceded by a separator
27 /// (and trailing whitespaces)
28 fn c() { }
29
30 /*
31  * some multi-line non-doc comment
32  */
33
34 /**
35  * some multi-line outer-docs
36  */
37 fn d() { }
38
39 fn e() {
40     /*!
41      * some multi-line inner-docs
42      */
43 }
44
45 /********************************/
46 /*
47  * some multi-line non-doc comment preceded by a separator
48  */
49
50 /********************************/
51 /**
52  * some multi-line outer-docs preceded by a separator
53  */
54 fn f() { }
55
56 #[doc = "unsugared outer doc-comments work also"]
57 fn g() { }
58
59 fn h() {
60     #![doc = "as do inner ones"]
61 }