Skip to content

Commit 97ed871

Browse files
committed
libcore: "tag" -> "enum"
1 parent c5a407b commit 97ed871

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type port_id = int;
6464
Channels may be duplicated and themselves transmitted \
6565
over other channels."
6666
)]
67-
tag chan<T: send> {
67+
enum chan<T: send> {
6868
chan_t(task::task, port_id);
6969
}
7070

@@ -89,7 +89,7 @@ resource port_ptr<T: send>(po: *rustrt::rust_port) {
8989
copied, both copies refer to the same port. \
9090
Ports may be associated with multiple <chan>s."
9191
)]
92-
tag port<T: send> { port_t(@port_ptr<T>); }
92+
enum port<T: send> { port_t(@port_ptr<T>); }
9393

9494
#[doc(
9595
brief = "Sends data over a channel. The sent data is moved \

src/libcore/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level, visible-everywhere definitions.
22

33
// Export type option as a synonym for option::t and export the some and none
4-
// tag constructors.
4+
// enum constructors.
55

66
import option::{some, none};
77
import option = option::t;

src/libcore/ctypes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type uint32_t = u32;
7272
but using pointers to this type when interoperating \
7373
with C void pointers can help in documentation."
7474
)]
75-
tag void {
75+
enum void {
7676
// Making the only variant reference itself makes it impossible to
7777
// construct. Not exporting it makes it impossible to destructure.
7878
void_private(@void);

src/libcore/either.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Tag: t
1010
1111
The either type
1212
*/
13-
tag t<T, U> {
13+
enum t<T, U> {
1414
/* Variant: left */
1515
left(T);
1616
/* Variant: right */

src/libcore/extfmt.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ import option::{some, none};
3939

4040
// Functions used by the fmt extension at compile time
4141
mod ct {
42-
tag signedness { signed; unsigned; }
43-
tag caseness { case_upper; case_lower; }
44-
tag ty {
42+
enum signedness { signed; unsigned; }
43+
enum caseness { case_upper; case_lower; }
44+
enum ty {
4545
ty_bool;
4646
ty_str;
4747
ty_char;
@@ -53,14 +53,14 @@ mod ct {
5353
ty_poly;
5454
// FIXME: More types
5555
}
56-
tag flag {
56+
enum flag {
5757
flag_left_justify;
5858
flag_left_zero_pad;
5959
flag_space_for_sign;
6060
flag_sign_always;
6161
flag_alternate;
6262
}
63-
tag count {
63+
enum count {
6464
count_is(int);
6565
count_is_param(int);
6666
count_is_next_param;
@@ -77,7 +77,7 @@ mod ct {
7777

7878

7979
// A fragment of the output sequence
80-
tag piece { piece_string(str); piece_conv(conv); }
80+
enum piece { piece_string(str); piece_conv(conv); }
8181
type error_fn = fn@(str) -> ! ;
8282

8383
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
@@ -263,7 +263,7 @@ mod ct {
263263
// conditions can be evaluated at compile-time. For now though it's cleaner to
264264
// implement it this way, I think.
265265
mod rt {
266-
tag flag {
266+
enum flag {
267267
flag_left_justify;
268268
flag_left_zero_pad;
269269
flag_space_for_sign;
@@ -276,8 +276,8 @@ mod rt {
276276
// comments in front::extfmt::make_flags
277277
flag_none;
278278
}
279-
tag count { count_is(int); count_implied; }
280-
tag ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
279+
enum count { count_is(int); count_implied; }
280+
enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
281281

282282
// FIXME: May not want to use a vector here for flags;
283283
// instead just use a bool per flag
@@ -391,7 +391,7 @@ mod rt {
391391

392392
ret str::unsafe_from_bytes(svec);
393393
}
394-
tag pad_mode { pad_signed; pad_unsigned; pad_nozero; }
394+
enum pad_mode { pad_signed; pad_unsigned; pad_nozero; }
395395
fn pad(cv: conv, s: str, mode: pad_mode) -> str {
396396
let uwidth;
397397
alt cv.width {

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Tag: t
1212
1313
The option type
1414
*/
15-
tag t<T> {
15+
enum t<T> {
1616
/* Variant: none */
1717
none;
1818
/* Variant: some */

src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Tag: t
1111
1212
The result type
1313
*/
14-
tag t<T, U> {
14+
enum t<T, U> {
1515
/*
1616
Variant: ok
1717

src/libcore/sys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Module: sys
33
44
Misc low level stuff
55
*/
6-
tag type_desc = {
6+
enum type_desc = {
77
first_param: **ctypes::c_int,
88
size: ctypes::size_t,
99
align: ctypes::size_t

src/libcore/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Tag: task_result
179179
180180
Indicates the manner in which a task exited
181181
*/
182-
tag task_result {
182+
enum task_result {
183183
/* Variant: tr_success */
184184
tr_success;
185185
/* Variant: tr_failure */
@@ -191,7 +191,7 @@ Tag: task_notification
191191
192192
Message sent upon task exit to indicate normal or abnormal termination
193193
*/
194-
tag task_notification {
194+
enum task_notification {
195195
/* Variant: exit */
196196
exit(task, task_result);
197197
}

0 commit comments

Comments
 (0)