about summary refs log tree commit diff
path: root/src/rustdoc/demo.rs
blob: cb50753d87e29aafe1b05980715950310a1364f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
// no-reformat

/*!
 * A demonstration module
 *
 * Contains documentation in various forms that rustdoc understands,
 * for testing purposes. It doesn't surve any functional
 * purpose. This here, for instance, is just some filler text.
 *
 * FIXME (#1654): It would be nice if we could run some automated
 * tests on this file
 */

/// The base price of a muffin on a non-holiday
const price_of_a_muffin: float = 70f;

type WaitPerson = {
    hair_color: ~str
};

/// The type of things that produce omnomnom
enum OmNomNomy {
    /// Delicious sugar cookies
    Cookie,
    /// It's pizza
    PizzaPie(~[uint])
}

fn take_my_order_please(
    _waitperson: WaitPerson,
    _order: ~[OmNomNomy]
) -> uint {

    /*!
     * OMG would you take my order already?
     *
     * # Arguments
     *
     * * _waitperson - The waitperson that you want to bother
     * * _order - The order vector. It should be filled with food
     *
     * # Return
     *
     * The price of the order, including tax
     *
     * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec
     * molestie nisl. Duis massa risus, pharetra a scelerisque a,
     * molestie eu velit. Donec mattis ligula at ante imperdiet ut
     * dapibus mauris malesuada.
     *
     * Sed gravida nisi a metus elementum sit amet hendrerit dolor
     * bibendum. Aenean sit amet neque massa, sed tempus tortor. Sed ut
     * lobortis enim. Proin a mauris quis nunc fermentum ultrices eget a
     * erat. Mauris in lectus vitae metus sodales auctor. Morbi nunc
     * quam, ultricies at venenatis non, pellentesque ac dui.
     *
     * # Failure
     *
     * This function is full of fail
     */

    fail;
}

mod fortress_of_solitude {
    /*!
     * Superman's vacation home
     *
     * The fortress of solitude is located in the Arctic and it is
     * cold. What you may not know about the fortress of solitude
     * though is that it contains two separate bowling alleys. One of
     * them features bumper-bowling and is kind of lame.
     *
     * Really, it's pretty cool.
     */

}

mod blade_runner {
    /*!
     * Blade Runner is probably the best movie ever
     *
     * I like that in the world of Blade Runner it is always
     * raining, and that it's always night time. And Aliens
     * was also a really good movie.
     *
     * Alien 3 was crap though.
     */
}

/**
 * Bored
 *
 * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec
 * molestie nisl. Duis massa risus, pharetra a scelerisque a,
 * molestie eu velit. Donec mattis ligula at ante imperdiet ut
 * dapibus mauris malesuada. Sed gravida nisi a metus elementum sit
 * amet hendrerit dolor bibendum. Aenean sit amet neque massa, sed
 * tempus tortor. Sed ut lobortis enim. Proin a mauris quis nunc
 * fermentum ultrices eget a erat. Mauris in lectus vitae metus
 * sodales auctor. Morbi nunc quam, ultricies at venenatis non,
 * pellentesque ac dui.
 *
 * Quisque vitae est id eros placerat laoreet sit amet eu
 * nisi. Curabitur suscipit neque porttitor est euismod
 * lacinia. Curabitur non quam vitae ipsum adipiscing
 * condimentum. Mauris ut ante eget metus sollicitudin
 * blandit. Aliquam erat volutpat. Morbi sed nisl mauris. Nulla
 * facilisi. Phasellus at mollis ipsum. Maecenas sed convallis
 * sapien. Nullam in ligula turpis. Pellentesque a neque augue. Sed
 * eget ante feugiat tortor congue auctor ac quis ante. Proin
 * condimentum lacinia tincidunt.
 */
struct Bored {
  bored: bool,
  drop { log(error, self.bored); }
}

/**
 * The Shunned House
 *
 * From even the greatest of horrors irony is seldom absent. Sometimes it
 * enters directly into the composition of the events, while sometimes it
 * relates only to their fortuitous position among persons and
 * places. The latter sort is splendidly exemplified by a case in the
 * ancient city of Providence, where in the late forties Edgar Allan Poe
 * used to sojourn often during his unsuccessful wooing of the gifted
 * poetess, Mrs.  Whitman. Poe generally stopped at the Mansion House in
 * Benefit Street--the renamed Golden Ball Inn whose roof has sheltered
 * Washington, Jefferson, and Lafayette--and his favorite walk led
 * northward along the same street to Mrs. Whitman's home and the
 * neighboring hillside churchyard of St. John's, whose hidden expanse of
 * Eighteenth Century gravestones had for him a peculiar fascination.
 */
trait TheShunnedHouse {
    /**
     * Now the irony is this. In this walk, so many times repeated, the
     * world's greatest master of the terrible and the bizarre was
     * obliged to pass a particular house on the eastern side of the
     * street; a dingy, antiquated structure perched on the abruptly
     * rising side hill, with a great unkempt yard dating from a time
     * when the region was partly open country. It does not appear that
     * he ever wrote or spoke of it, nor is there any evidence that he
     * even noticed it. And yet that house, to the two persons in
     * possession of certain information, equals or outranks in horror
     * the wildest fantasy of the genius who so often passed it
     * unknowingly, and stands starkly leering as a symbol of all that is
     * unutterably hideous.
     *
     * # Arguments
     *
     * * unkempt_yard - A yard dating from a time when the region was partly
     *                  open country
     */
    fn dingy_house(unkempt_yard: int);

    /**
     * The house was--and for that matter still is--of a kind to attract
     * the attention of the curious. Originally a farm or semi-farm
     * building, it followed the average New England colonial lines of
     * the middle Eighteenth Century--the prosperous peaked-roof sort,
     * with two stories and dormerless attic, and with the Georgian
     * doorway and interior panelling dictated by the progress of taste
     * at that time. It faced south, with one gable end buried to the
     * lower windows in the eastward rising hill, and the other exposed
     * to the foundations toward the street. Its construction, over a
     * century and a half ago, had followed the grading and straightening
     * of the road in that especial vicinity; for Benefit Street--at
     * first called Back Street--was laid out as a lane winding amongst
     * the graveyards of the first settlers, and straightened only when
     * the removal of the bodies to the North Burial Ground made it
     * decently possible to cut through the old family plots.
     */
    fn construct() -> bool;
}

/// Whatever
impl OmNomNomy: TheShunnedHouse {
    fn dingy_house(_unkempt_yard: int) {
    }

    fn construct() -> bool {
        fail;
    }
}