Skip to content

Commit e5d095d

Browse files
committed
Change option::t to option
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
1 parent 1f795ff commit e5d095d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+362
-365
lines changed

src/cargo/cargo.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ type package = {
3232
url: str,
3333
method: str,
3434
description: str,
35-
ref: option::t<str>,
35+
ref: option<str>,
3636
tags: [str]
3737
};
3838

3939
type source = {
4040
name: str,
4141
url: str,
42-
sig: option::t<str>,
43-
key: option::t<str>,
44-
keyfp: option::t<str>,
42+
sig: option<str>,
43+
key: option<str>,
44+
keyfp: option<str>,
4545
mutable packages: [package]
4646
};
4747

@@ -60,9 +60,9 @@ type pkg = {
6060
name: str,
6161
vers: str,
6262
uuid: str,
63-
desc: option::t<str>,
64-
sigs: option::t<str>,
65-
crate_type: option::t<str>
63+
desc: option<str>,
64+
sigs: option<str>,
65+
crate_type: option<str>
6666
};
6767

6868
fn info(msg: str) {
@@ -77,9 +77,9 @@ fn error(msg: str) {
7777
io::stdout().write_line("error: " + msg);
7878
}
7979

80-
fn load_link(mis: [@ast::meta_item]) -> (option::t<str>,
81-
option::t<str>,
82-
option::t<str>) {
80+
fn load_link(mis: [@ast::meta_item]) -> (option<str>,
81+
option<str>,
82+
option<str>) {
8383
let name = none;
8484
let vers = none;
8585
let uuid = none;
@@ -99,7 +99,7 @@ fn load_link(mis: [@ast::meta_item]) -> (option::t<str>,
9999
(name, vers, uuid)
100100
}
101101

102-
fn load_pkg(filename: str) -> option::t<pkg> {
102+
fn load_pkg(filename: str) -> option<pkg> {
103103
let cm = codemap::new_codemap();
104104
let handler = diagnostic::mk_handler(none);
105105
let sess = @{
@@ -439,7 +439,7 @@ fn install_source(c: cargo, path: str) {
439439
}
440440
}
441441

442-
fn install_git(c: cargo, wd: str, url: str, ref: option::t<str>) {
442+
fn install_git(c: cargo, wd: str, url: str, ref: option<str>) {
443443
run::run_program("git", ["clone", url, wd]);
444444
if option::is_some::<str>(ref) {
445445
let r = option::get::<str>(ref);

src/comp/back/link.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn llvm_err(sess: session, msg: str) unsafe {
3838
} else { sess.fatal(msg + ": " + str::from_cstr(buf)); }
3939
}
4040

41-
fn load_intrinsics_bc(sess: session) -> option::t<ModuleRef> {
41+
fn load_intrinsics_bc(sess: session) -> option<ModuleRef> {
4242
let path = alt filesearch::search(
4343
sess.filesearch,
4444
bind filesearch::pick_file("intrinsics.bc", _)) {
@@ -368,14 +368,14 @@ fn build_link_meta(sess: session, c: ast::crate, output: str,
368368
sha: sha1) -> link_meta {
369369

370370
type provided_metas =
371-
{name: option::t<str>,
372-
vers: option::t<str>,
371+
{name: option<str>,
372+
vers: option<str>,
373373
cmh_items: [@ast::meta_item]};
374374

375375
fn provided_link_metas(sess: session, c: ast::crate) ->
376376
provided_metas {
377-
let name: option::t<str> = none;
378-
let vers: option::t<str> = none;
377+
let name: option<str> = none;
378+
let vers: option<str> = none;
379379
let cmh_items: [@ast::meta_item] = [];
380380
let linkage_metas = attr::find_linkage_metas(c.node.attrs);
381381
attr::require_unique_names(sess, linkage_metas);

src/comp/driver/driver.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ enum compile_upto {
105105

106106
fn compile_upto(sess: session, cfg: ast::crate_cfg,
107107
input: str, upto: compile_upto,
108-
outputs: option::t<output_filenames>)
109-
-> {crate: @ast::crate, tcx: option::t<ty::ctxt>} {
108+
outputs: option<output_filenames>)
109+
-> {crate: @ast::crate, tcx: option<ty::ctxt>} {
110110
let time_passes = sess.opts.time_passes;
111111
let crate = time(time_passes, "parsing",
112112
bind parse_input(sess, cfg, input));
@@ -197,7 +197,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
197197
}
198198

199199
fn compile_input(sess: session, cfg: ast::crate_cfg, input: str,
200-
outdir: option::t<str>, output: option::t<str>) {
200+
outdir: option<str>, output: option<str>) {
201201

202202
let upto = if sess.opts.parse_only { cu_parse }
203203
else if sess.opts.no_trans { cu_no_trans }
@@ -504,8 +504,8 @@ fn opts() -> [getopts::opt] {
504504
type output_filenames = @{out_filename: str, obj_filename:str};
505505

506506
fn build_output_filenames(ifile: str,
507-
odir: option::t<str>,
508-
ofile: option::t<str>,
507+
odir: option<str>,
508+
ofile: option<str>,
509509
sess: session)
510510
-> output_filenames {
511511
let obj_path = "";

src/comp/driver/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type options =
4040
time_llvm_passes: bool,
4141
output_type: back::link::output_type,
4242
addl_lib_search_paths: [str],
43-
maybe_sysroot: option::t<str>,
43+
maybe_sysroot: option<str>,
4444
target_triple: str,
4545
cfg: ast::crate_cfg,
4646
test: bool,
@@ -58,7 +58,7 @@ type session = @{targ_cfg: @config,
5858
parse_sess: parse_sess,
5959
codemap: codemap::codemap,
6060
// For a library crate, this is always none
61-
mutable main_fn: option::t<(node_id, codemap::span)>,
61+
mutable main_fn: option<(node_id, codemap::span)>,
6262
span_diagnostic: diagnostic::span_handler,
6363
filesearch: filesearch::filesearch,
6464
mutable building_library: bool,

src/comp/front/attr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn find_linkage_metas(attrs: [ast::attribute]) -> [@ast::meta_item] {
4848
fn find_attrs_by_name(attrs: [ast::attribute], name: ast::ident) ->
4949
[ast::attribute] {
5050
let filter = (
51-
fn@(a: ast::attribute) -> option::t<ast::attribute> {
51+
fn@(a: ast::attribute) -> option<ast::attribute> {
5252
if get_attr_name(a) == name {
5353
option::some(a)
5454
} else { option::none }
@@ -67,7 +67,7 @@ fn get_attr_name(attr: ast::attribute) -> ast::ident {
6767

6868
fn find_meta_items_by_name(metas: [@ast::meta_item], name: ast::ident) ->
6969
[@ast::meta_item] {
70-
let filter = fn@(&&m: @ast::meta_item) -> option::t<@ast::meta_item> {
70+
let filter = fn@(&&m: @ast::meta_item) -> option<@ast::meta_item> {
7171
if get_meta_item_name(m) == name {
7272
option::some(m)
7373
} else { option::none }
@@ -85,7 +85,7 @@ fn get_meta_item_name(meta: @ast::meta_item) -> ast::ident {
8585

8686
// Gets the string value if the meta_item is a meta_name_value variant
8787
// containing a string, otherwise none
88-
fn get_meta_item_value_str(meta: @ast::meta_item) -> option::t<str> {
88+
fn get_meta_item_value_str(meta: @ast::meta_item) -> option<str> {
8989
alt meta.node {
9090
ast::meta_name_value(_, v) {
9191
alt v.node { ast::lit_str(s) { option::some(s) } _ { option::none } }
@@ -95,15 +95,15 @@ fn get_meta_item_value_str(meta: @ast::meta_item) -> option::t<str> {
9595
}
9696

9797
fn get_meta_item_value_str_by_name(attrs: [ast::attribute], name: ast::ident)
98-
-> option::t<str> {
98+
-> option<str> {
9999
let mattrs = find_attrs_by_name(attrs, name);
100100
if vec::len(mattrs) > 0u {
101101
ret get_meta_item_value_str(attr_meta(mattrs[0]));
102102
}
103103
ret option::none;
104104
}
105105

106-
fn get_meta_item_list(meta: @ast::meta_item) -> option::t<[@ast::meta_item]> {
106+
fn get_meta_item_list(meta: @ast::meta_item) -> option<[@ast::meta_item]> {
107107
alt meta.node {
108108
ast::meta_list(_, l) { option::some(l) }
109109
_ { option::none }
@@ -184,7 +184,7 @@ fn sort_meta_items(items: [@ast::meta_item]) -> [@ast::meta_item] {
184184
fn remove_meta_items_by_name(items: [@ast::meta_item], name: str) ->
185185
[@ast::meta_item] {
186186

187-
let filter = fn@(&&item: @ast::meta_item) -> option::t<@ast::meta_item> {
187+
let filter = fn@(&&item: @ast::meta_item) -> option<@ast::meta_item> {
188188
if get_meta_item_name(item) != name {
189189
option::some(item)
190190
} else { option::none }

src/comp/front/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn strip_items(crate: @ast::crate, in_cfg: in_cfg_pred)
3737
}
3838

3939
fn filter_item(cx: ctxt, &&item: @ast::item) ->
40-
option::t<@ast::item> {
40+
option<@ast::item> {
4141
if item_in_cfg(cx, item) { option::some(item) } else { option::none }
4242
}
4343

@@ -50,7 +50,7 @@ fn fold_mod(cx: ctxt, m: ast::_mod, fld: fold::ast_fold) ->
5050
}
5151

5252
fn filter_native_item(cx: ctxt, &&item: @ast::native_item) ->
53-
option::t<@ast::native_item> {
53+
option<@ast::native_item> {
5454
if native_item_in_cfg(cx, item) {
5555
option::some(item)
5656
} else { option::none }
@@ -65,7 +65,7 @@ fn fold_native_mod(cx: ctxt, nm: ast::native_mod,
6565
}
6666

6767
fn filter_stmt(cx: ctxt, &&stmt: @ast::stmt) ->
68-
option::t<@ast::stmt> {
68+
option<@ast::stmt> {
6969
alt stmt.node {
7070
ast::stmt_decl(decl, _) {
7171
alt decl.node {

src/comp/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn fold_mod(_cx: test_ctxt, m: ast::_mod, fld: fold::ast_fold) -> ast::_mod {
6767
// the one we're going to add. FIXME: This is sloppy. Instead we should
6868
// have some mechanism to indicate to the translation pass which function
6969
// we want to be main.
70-
fn nomain(&&item: @ast::item) -> option::t<@ast::item> {
70+
fn nomain(&&item: @ast::item) -> option<@ast::item> {
7171
alt item.node {
7272
ast::item_fn(_, _, _) {
7373
if item.ident == "main" {

src/comp/lib/llvm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,11 @@ fn associate_type(tn: type_names, s: str, t: TypeRef) {
917917
assert tn.named_types.insert(s, t);
918918
}
919919

920-
fn type_has_name(tn: type_names, t: TypeRef) -> option::t<str> {
920+
fn type_has_name(tn: type_names, t: TypeRef) -> option<str> {
921921
ret tn.type_names.find(t);
922922
}
923923

924-
fn name_has_type(tn: type_names, s: str) -> option::t<TypeRef> {
924+
fn name_has_type(tn: type_names, s: str) -> option<TypeRef> {
925925
ret tn.named_types.find(s);
926926
}
927927

@@ -1072,7 +1072,7 @@ resource object_file_res(ObjectFile: ObjectFileRef) {
10721072

10731073
type object_file = {llof: ObjectFileRef, dtor: @object_file_res};
10741074

1075-
fn mk_object_file(llmb: MemoryBufferRef) -> option::t<object_file> {
1075+
fn mk_object_file(llmb: MemoryBufferRef) -> option<object_file> {
10761076
let llof = llvm::LLVMCreateObjectFile(llmb);
10771077
if llof as int == 0 { ret option::none::<object_file>; }
10781078
ret option::some({llof: llof, dtor: @object_file_res(llof)});

src/comp/metadata/creader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn default_native_lib_naming(sess: session::session, static: bool) ->
137137

138138
fn find_library_crate(sess: session::session, ident: ast::ident,
139139
metas: [@ast::meta_item])
140-
-> option::t<{ident: str, data: @[u8]}> {
140+
-> option<{ident: str, data: @[u8]}> {
141141

142142
attr::require_unique_names(sess, metas);
143143
let metas = metas;
@@ -173,7 +173,7 @@ fn find_library_crate_aux(sess: session::session,
173173
crate_name: str,
174174
metas: [@ast::meta_item],
175175
filesearch: filesearch::filesearch) ->
176-
option::t<{ident: str, data: @[u8]}> {
176+
option<{ident: str, data: @[u8]}> {
177177
let prefix: str = nn.prefix + crate_name + "-";
178178
let suffix: str = nn.suffix;
179179

@@ -206,7 +206,7 @@ fn find_library_crate_aux(sess: session::session,
206206
}
207207

208208
fn get_metadata_section(sess: session::session,
209-
filename: str) -> option::t<@[u8]> unsafe {
209+
filename: str) -> option<@[u8]> unsafe {
210210
let mb = str::as_buf(filename, {|buf|
211211
llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf)
212212
});

src/comp/metadata/csearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn get_enum_variants(tcx: ty::ctxt, def: ast::def_id) -> [ty::variant_info] {
6363
}
6464

6565
fn get_impls_for_mod(cstore: cstore::cstore, def: ast::def_id,
66-
name: option::t<ast::ident>)
66+
name: option<ast::ident>)
6767
-> @[@middle::resolve::_impl] {
6868
let cdata = cstore::get_crate_data(cstore, def.crate);
6969
decoder::get_impls_for_mod(cdata, def.node, name)
@@ -82,7 +82,7 @@ fn get_type(tcx: ty::ctxt, def: ast::def_id) -> ty::ty_param_bounds_and_ty {
8282
}
8383

8484
fn get_impl_iface(tcx: ty::ctxt, def: ast::def_id)
85-
-> option::t<ty::t> {
85+
-> option<ty::t> {
8686
let cstore = tcx.sess.cstore;
8787
let cdata = cstore::get_crate_data(cstore, def.crate);
8888
decoder::get_impl_iface(cdata, def.node, tcx)

src/comp/metadata/decoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn lookup_hash(d: ebml::doc, eq_fn: fn@([u8]) -> bool, hash: uint) ->
5555
ret result;
5656
}
5757

58-
fn maybe_find_item(item_id: int, items: ebml::doc) -> option::t<ebml::doc> {
58+
fn maybe_find_item(item_id: int, items: ebml::doc) -> option<ebml::doc> {
5959
fn eq_item(bytes: [u8], item_id: int) -> bool {
6060
ret ebml::be_uint_from_bytes(@bytes, 0u, 4u) as int == item_id;
6161
}
@@ -92,7 +92,7 @@ fn variant_enum_id(d: ebml::doc) -> ast::def_id {
9292
ret parse_def_id(ebml::doc_data(tagdoc));
9393
}
9494

95-
fn variant_disr_val(d: ebml::doc) -> option::t<int> {
95+
fn variant_disr_val(d: ebml::doc) -> option<int> {
9696
alt ebml::maybe_get_doc(d, tag_disr_val) {
9797
some(val_doc) {
9898
let val_buf = ebml::doc_data(val_doc);
@@ -118,7 +118,7 @@ fn item_type(item: ebml::doc, tcx: ty::ctxt, cdata: cmd) -> ty::t {
118118
}
119119

120120
fn item_impl_iface(item: ebml::doc, tcx: ty::ctxt, cdata: cmd)
121-
-> option::t<ty::t> {
121+
-> option<ty::t> {
122122
let result = none;
123123
ebml::tagged_docs(item, tag_impl_iface) {|ity|
124124
let t = parse_ty_data(ity.data, cdata.cnum, ity.start, tcx, {|did|
@@ -227,7 +227,7 @@ fn get_type_param_count(data: @[u8], id: ast::node_id) -> uint {
227227
}
228228

229229
fn get_impl_iface(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
230-
-> option::t<ty::t> {
230+
-> option<ty::t> {
231231
item_impl_iface(lookup_item(id, cdata.data), tcx, cdata)
232232
}
233233

@@ -279,7 +279,7 @@ fn item_impl_methods(cdata: cmd, item: ebml::doc, base_tps: uint)
279279
}
280280

281281
fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id,
282-
name: option::t<ast::ident>)
282+
name: option<ast::ident>)
283283
-> @[@middle::resolve::_impl] {
284284
let data = cdata.data;
285285
let mod_item = lookup_item(m_id, data), result = [];

0 commit comments

Comments
 (0)