]> git.lizzy.rs Git - rust.git/blob - src/test/pretty/doc-comments.rs
Auto merge of #27584 - TimNN:macro-eof-span, r=huonw
[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 // compile-flags: --crate-type=lib
12
13 // pp-exact
14
15 // some single-line non-doc comment
16
17 /// some single line outer-docs
18 fn a() { }
19
20 fn b() {
21     //! some single line inner-docs
22 }
23
24 //////////////////////////////////
25 // some single-line non-doc comment preceded by a separator
26
27 //////////////////////////////////
28 /// some single-line outer-docs preceded by a separator
29 /// (and trailing whitespaces)
30 fn c() { }
31
32 /*
33  * some multi-line non-doc comment
34  */
35
36 /**
37  * some multi-line outer-docs
38  */
39 fn d() { }
40
41 fn e() {
42     /*!
43      * some multi-line inner-docs
44      */
45 }
46
47 /********************************/
48 /*
49  * some multi-line non-doc comment preceded by a separator
50  */
51
52 /********************************/
53 /**
54  * some multi-line outer-docs preceded by a separator
55  */
56 fn f() { }
57
58 #[doc = "unsugared outer doc-comments work also"]
59 fn g() { }
60
61 fn h() {
62     #![doc = "as do inner ones"]
63 }