Skip to content

Commit b226ea0

Browse files
ericktgraydon
authored andcommitted
---
yaml --- r: 4736 b: refs/heads/master c: e4a0f99 h: refs/heads/master v: v3
1 parent 840f2e7 commit b226ea0

Some content is hidden

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

52 files changed

+569
-569
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: f764f9a8cf52e686ba6e54b594e6bbbdd5bc7b32
2+
refs/heads/master: e4a0f997fb01b9cbb650532fea1278159faff064

trunk/src/comp/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The 3 central data structures:
3333
structure:
3434

3535
- Many -- though not all -- nodes within this data structure are
36-
wrapped in the type spanned[T], meaning that the front-end has
36+
wrapped in the type spanned<T>, meaning that the front-end has
3737
marked the input coordinates of that node. The member .node is
3838
the data itself, the member .span is the input location (file,
3939
line, column; both low and high).

trunk/src/comp/back/link.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,14 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
285285
sha: sha1) -> link_meta {
286286

287287
type provided_metas =
288-
{name: option::t[str],
289-
vers: option::t[str],
288+
{name: option::t<str>,
289+
vers: option::t<str>,
290290
cmh_items: [@ast::meta_item]};
291291

292292
fn provided_link_metas(sess: &session::session, c: &ast::crate) ->
293293
provided_metas {
294-
let name: option::t[str] = none;
295-
let vers: option::t[str] = none;
294+
let name: option::t<str> = none;
295+
let vers: option::t<str> = none;
296296
let cmh_items: [@ast::meta_item] = ~[];
297297
let linkage_metas = attr::find_linkage_metas(c.node.attrs);
298298
attr::require_unique_names(sess, linkage_metas);

trunk/src/comp/driver/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ fn opts() -> [getopts::opt] {
437437
optflag("lib"), optflag("static"), optflag("gc")];
438438
}
439439

440-
fn main(args: vec[str]) {
440+
fn main(args: vec<str>) {
441441
let args_ivec = vec::from_vec(args);
442442
let binary = vec::shift(args_ivec);
443443
let binary_dir = fs::dirname(binary);

trunk/src/comp/driver/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ obj session(targ_cfg: @config,
5454
parse_sess: parse_sess,
5555

5656
// For a library crate, this is always none
57-
mutable main_fn: option::t[node_id],
57+
mutable main_fn: option::t<node_id>,
5858
mutable err_count: uint) {
5959
fn get_targ_cfg() -> @config { ret targ_cfg; }
6060
fn get_opts() -> @options { ret opts; }
@@ -111,7 +111,7 @@ obj session(targ_cfg: @config,
111111
ret codemap::span_to_str(sp, self.get_codemap());
112112
}
113113
fn set_main_id(d: node_id) { main_fn = some(d); }
114-
fn get_main_id() -> option::t[node_id] { main_fn }
114+
fn get_main_id() -> option::t<node_id> { main_fn }
115115
}
116116
// Local Variables:
117117
// fill-column: 78;

trunk/src/comp/front/attr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn find_attrs_by_name(attrs: &[ast::attribute], name: ast::ident) ->
4545
[ast::attribute] {
4646
let filter =
4747
bind fn (a: &ast::attribute, name: ast::ident) ->
48-
option::t[ast::attribute] {
48+
option::t<ast::attribute> {
4949
if get_attr_name(a) == name {
5050
option::some(a)
5151
} else { option::none }
@@ -61,7 +61,7 @@ fn find_meta_items_by_name(metas: &[@ast::meta_item], name: ast::ident) ->
6161
[@ast::meta_item] {
6262
let filter =
6363
bind fn (m: &@ast::meta_item, name: ast::ident) ->
64-
option::t[@ast::meta_item] {
64+
option::t<@ast::meta_item> {
6565
if get_meta_item_name(m) == name {
6666
option::some(m)
6767
} else { option::none }
@@ -79,7 +79,7 @@ fn get_meta_item_name(meta: &@ast::meta_item) -> ast::ident {
7979

8080
// Gets the string value if the meta_item is a meta_name_value variant
8181
// containing a string, otherwise none
82-
fn get_meta_item_value_str(meta: &@ast::meta_item) -> option::t[str] {
82+
fn get_meta_item_value_str(meta: &@ast::meta_item) -> option::t<str> {
8383
alt meta.node {
8484
ast::meta_name_value(_, v) {
8585
alt v.node {
@@ -167,7 +167,7 @@ fn remove_meta_items_by_name(items: &[@ast::meta_item], name: str) ->
167167

168168
let filter =
169169
bind fn (item: &@ast::meta_item, name: str) ->
170-
option::t[@ast::meta_item] {
170+
option::t<@ast::meta_item> {
171171
if get_meta_item_name(item) != name {
172172
option::some(item)
173173
} else { option::none }
@@ -189,7 +189,7 @@ fn require_unique_names(sess: &session::session,
189189
}
190190
}
191191

192-
fn span[T](item: &T) -> ast::spanned[T] {
192+
fn span[T](item: &T) -> ast::spanned<T> {
193193
ret {node: item, span: ast::mk_sp(0u, 0u)};
194194
}
195195

trunk/src/comp/front/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn strip_unconfigured_items(crate: @ast::crate) -> @ast::crate {
2525
}
2626

2727
fn filter_item(cfg: &ast::crate_cfg, item: &@ast::item) ->
28-
option::t[@ast::item] {
28+
option::t<@ast::item> {
2929
if item_in_cfg(cfg, item) { option::some(item) } else { option::none }
3030
}
3131

@@ -38,7 +38,7 @@ fn fold_mod(cfg: &ast::crate_cfg, m: &ast::_mod, fld: fold::ast_fold) ->
3838
}
3939

4040
fn filter_native_item(cfg: &ast::crate_cfg, item: &@ast::native_item) ->
41-
option::t[@ast::native_item] {
41+
option::t<@ast::native_item> {
4242
if native_item_in_cfg(cfg, item) {
4343
option::some(item)
4444
} else { option::none }
@@ -55,7 +55,7 @@ fn fold_native_mod(cfg: &ast::crate_cfg, nm: &ast::native_mod,
5555
}
5656

5757
fn filter_stmt(cfg: &ast::crate_cfg, stmt: &@ast::stmt) ->
58-
option::t[@ast::stmt] {
58+
option::t<@ast::stmt> {
5959
alt stmt.node {
6060
ast::stmt_decl(decl, _) {
6161
alt decl.node {

trunk/src/comp/front/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn fold_mod(cx: &test_ctxt, m: &ast::_mod, fld: fold::ast_fold) -> ast::_mod {
5757
// the one we're going to add. FIXME: This is sloppy. Instead we should
5858
// have some mechanism to indicate to the translation pass which function
5959
// we want to be main.
60-
fn nomain(item: &@ast::item) -> option::t[@ast::item] {
60+
fn nomain(item: &@ast::item) -> option::t<@ast::item> {
6161
alt item.node {
6262
ast::item_fn(f, _) {
6363
if item.ident == "main" {
@@ -167,7 +167,7 @@ fn mk_test_module(cx: &test_ctxt) -> @ast::item {
167167
ret @item;
168168
}
169169

170-
fn nospan[T](t: &T) -> ast::spanned[T] {
170+
fn nospan[T](t: &T) -> ast::spanned<T> {
171171
ret {node: t, span: ast::dummy_sp()};
172172
}
173173

trunk/src/comp/lib/llvm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,8 @@ fn new_builder(llbb: BasicBlockRef) -> builder {
14201420

14211421
/* Memory-managed object interface to type handles. */
14221422

1423-
obj type_names(type_names: std::map::hashmap[TypeRef, str],
1424-
named_types: std::map::hashmap[str, TypeRef]) {
1423+
obj type_names(type_names: std::map::hashmap<TypeRef, str>,
1424+
named_types: std::map::hashmap<str, TypeRef>) {
14251425

14261426
fn associate(s: str, t: TypeRef) {
14271427
assert (!named_types.contains_key(s));
@@ -1446,8 +1446,8 @@ fn mk_type_names() -> type_names {
14461446

14471447
fn eq(a: &TypeRef, b: &TypeRef) -> bool { ret a as uint == b as uint; }
14481448

1449-
let hasher: std::map::hashfn[TypeRef] = hash;
1450-
let eqer: std::map::eqfn[TypeRef] = eq;
1449+
let hasher: std::map::hashfn<TypeRef> = hash;
1450+
let eqer: std::map::eqfn<TypeRef> = eq;
14511451
let tn = std::map::mk_hashmap[TypeRef, str](hasher, eqer);
14521452

14531453
ret type_names(tn, nt);

trunk/src/comp/metadata/creader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn read_crates(sess: session::session, crate: &ast::crate) {
4545

4646
type env =
4747
@{sess: session::session,
48-
crate_cache: @hashmap[str, int],
48+
crate_cache: @hashmap<str, int>,
4949
library_search_paths: [str],
5050
mutable next_crate_num: ast::crate_num};
5151

@@ -118,7 +118,7 @@ fn default_native_lib_naming(sess: session::session, static: bool) ->
118118
fn find_library_crate(sess: &session::session, ident: &ast::ident,
119119
metas: &[@ast::meta_item],
120120
library_search_paths: &[str]) ->
121-
option::t[{ident: str, data: @[u8]}] {
121+
option::t<{ident: str, data: @[u8]}> {
122122

123123
attr::require_unique_names(sess, metas);
124124

@@ -148,7 +148,7 @@ fn find_library_crate(sess: &session::session, ident: &ast::ident,
148148
fn find_library_crate_aux(nn: &{prefix: str, suffix: str}, crate_name: str,
149149
metas: &[@ast::meta_item],
150150
library_search_paths: &[str]) ->
151-
option::t[{ident: str, data: @[u8]}] {
151+
option::t<{ident: str, data: @[u8]}> {
152152
let prefix: str = nn.prefix + crate_name;
153153
// FIXME: we could probably use a 'glob' function in std::fs but it will
154154
// be much easier to write once the unsafe module knows more about FFI
@@ -183,7 +183,7 @@ fn find_library_crate_aux(nn: &{prefix: str, suffix: str}, crate_name: str,
183183
ret none;
184184
}
185185

186-
fn get_metadata_section(filename: str) -> option::t[@[u8]] {
186+
fn get_metadata_section(filename: str) -> option::t<@[u8]> {
187187
let b = str::buf(filename);
188188
let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(b);
189189
if mb as int == 0 { ret option::none[@[u8]]; }

trunk/src/comp/metadata/cstore.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export get_use_stmt_cnum;
2727
// local crate numbers (as generated during this session). Each external
2828
// crate may refer to types in other external crates, and each has their
2929
// own crate numbers.
30-
type cnum_map = map::hashmap[ast::crate_num, ast::crate_num];
30+
type cnum_map = map::hashmap<ast::crate_num, ast::crate_num>;
3131

3232
type crate_metadata = {name: str, data: @[u8], cnum_map: cnum_map};
3333

@@ -39,14 +39,14 @@ type crate_metadata = {name: str, data: @[u8], cnum_map: cnum_map};
3939
tag cstore { private(cstore_private); }
4040

4141
type cstore_private =
42-
@{metas: map::hashmap[ast::crate_num, crate_metadata],
42+
@{metas: map::hashmap<ast::crate_num, crate_metadata>,
4343
use_crate_map: use_crate_map,
4444
mutable used_crate_files: [str],
4545
mutable used_libraries: [str],
4646
mutable used_link_args: [str]};
4747

4848
// Map from node_id's of local use statements to crate numbers
49-
type use_crate_map = map::hashmap[ast::node_id, ast::crate_num];
49+
type use_crate_map = map::hashmap<ast::node_id, ast::crate_num>;
5050

5151
// Internal method to retrieve the data from the cstore
5252
fn p(cstore: &cstore) -> cstore_private { alt cstore { private(p) { p } } }

trunk/src/comp/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn lookup_hash(d: &ebml::doc, eq_fn: fn(&[u8]) -> bool , hash: uint) ->
5656
}
5757

5858
fn maybe_find_item(item_id: int, items: &ebml::doc) ->
59-
option::t[ebml::doc] {
59+
option::t<ebml::doc> {
6060
fn eq_item(bytes: &[u8], item_id: int) -> bool {
6161
ret ebml::be_uint_from_bytes(@bytes, 0u, 4u) as int == item_id;
6262
}

trunk/src/comp/metadata/encoder.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import front::attr;
1919
export encode_metadata;
2020
export encoded_ty;
2121

22-
type abbrev_map = map::hashmap[ty::t, tyencode::ty_abbrev];
22+
type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
2323

2424
type encode_ctxt = {ccx: @crate_ctxt, type_abbrevs: abbrev_map};
2525

@@ -39,7 +39,7 @@ fn encode_def_id(ebml_w: &ebml::writer, id: &def_id) {
3939
type entry[T] = {val: T, pos: uint};
4040

4141
fn encode_tag_variant_paths(ebml_w: &ebml::writer, variants: &[variant],
42-
path: &[str], index: &mutable [entry[str]]) {
42+
path: &[str], index: &mutable [entry<str>]) {
4343
for variant: variant in variants {
4444
add_to_index(ebml_w, path, index, variant.node.name);
4545
ebml::start_tag(ebml_w, tag_paths_data_item);
@@ -50,7 +50,7 @@ fn encode_tag_variant_paths(ebml_w: &ebml::writer, variants: &[variant],
5050
}
5151

5252
fn add_to_index(ebml_w: &ebml::writer, path: &[str],
53-
index: &mutable [entry[str]], name: &str) {
53+
index: &mutable [entry<str>], name: &str) {
5454
let full_path = path + ~[name];
5555
index +=
5656
~[{val: str::connect(full_path, "::"),
@@ -59,7 +59,7 @@ fn add_to_index(ebml_w: &ebml::writer, path: &[str],
5959

6060
fn encode_native_module_item_paths(ebml_w: &ebml::writer,
6161
nmod: &native_mod, path: &[str],
62-
index: &mutable [entry[str]]) {
62+
index: &mutable [entry<str>]) {
6363
for nitem: @native_item in nmod.items {
6464
add_to_index(ebml_w, path, index, nitem.ident);
6565
ebml::start_tag(ebml_w, tag_paths_data_item);
@@ -70,7 +70,7 @@ fn encode_native_module_item_paths(ebml_w: &ebml::writer,
7070
}
7171

7272
fn encode_module_item_paths(ebml_w: &ebml::writer, module: &_mod,
73-
path: &[str], index: &mutable [entry[str]]) {
73+
path: &[str], index: &mutable [entry<str>]) {
7474
for it: @item in module.items {
7575
if !is_exported(it.ident, module) { cont; }
7676
alt it.node {
@@ -149,8 +149,8 @@ fn encode_module_item_paths(ebml_w: &ebml::writer, module: &_mod,
149149
}
150150

151151
fn encode_item_paths(ebml_w: &ebml::writer, crate: &@crate) ->
152-
[entry[str]] {
153-
let index: [entry[str]] = ~[];
152+
[entry<str>] {
153+
let index: [entry<str>] = ~[];
154154
let path: [str] = ~[];
155155
ebml::start_tag(ebml_w, tag_paths);
156156
encode_module_item_paths(ebml_w, crate.node.module, path, index);
@@ -226,7 +226,7 @@ fn encode_tag_id(ebml_w: &ebml::writer, id: &def_id) {
226226

227227
fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
228228
id: node_id, variants: &[variant],
229-
index: &mutable [entry[int]],
229+
index: &mutable [entry<int>],
230230
ty_params: &[ty_param]) {
231231
for variant: variant in variants {
232232
index += ~[{val: variant.node.id, pos: ebml_w.writer.tell()}];
@@ -246,7 +246,7 @@ fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
246246
}
247247

248248
fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebml::writer,
249-
item: @item, index: &mutable [entry[int]]) {
249+
item: @item, index: &mutable [entry<int>]) {
250250
alt item.node {
251251
item_const(_, _) {
252252
ebml::start_tag(ebml_w, tag_items_data_item);
@@ -368,8 +368,8 @@ fn encode_info_for_native_item(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
368368
}
369369

370370
fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebml::writer) ->
371-
[entry[int]] {
372-
let index: [entry[int]] = ~[];
371+
[entry<int>] {
372+
let index: [entry<int>] = ~[];
373373
ebml::start_tag(ebml_w, tag_items_data);
374374
for each kvp: @{key: node_id, val: middle::ast_map::ast_node} in
375375
ecx.ccx.ast_map.items() {
@@ -392,32 +392,32 @@ fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebml::writer) ->
392392

393393
// Path and definition ID indexing
394394

395-
fn create_index[T](index: &[entry[T]], hash_fn: fn(&T) -> uint ) ->
396-
[@[entry[T]]] {
397-
let buckets: [@mutable [entry[T]]] = ~[];
395+
fn create_index[T](index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
396+
[@[entry<T>]] {
397+
let buckets: [@mutable [entry<T>]] = ~[];
398398
for each i: uint in uint::range(0u, 256u) { buckets += ~[@mutable ~[]]; }
399-
for elt: entry[T] in index {
399+
for elt: entry<T> in index {
400400
let h = hash_fn(elt.val);
401401
*buckets.(h % 256u) += ~[elt];
402402
}
403403

404404
let buckets_frozen = ~[];
405-
for bucket: @mutable [entry[T]] in buckets {
405+
for bucket: @mutable [entry<T>] in buckets {
406406
buckets_frozen += ~[@*bucket];
407407
}
408408
ret buckets_frozen;
409409
}
410410

411-
fn encode_index[T](ebml_w: &ebml::writer, buckets: &[@[entry[T]]],
411+
fn encode_index[T](ebml_w: &ebml::writer, buckets: &[@[entry<T>]],
412412
write_fn: fn(&io::writer, &T) ) {
413413
let writer = io::new_writer_(ebml_w.writer);
414414
ebml::start_tag(ebml_w, tag_index);
415415
let bucket_locs: [uint] = ~[];
416416
ebml::start_tag(ebml_w, tag_index_buckets);
417-
for bucket: @[entry[T]] in buckets {
417+
for bucket: @[entry<T>] in buckets {
418418
bucket_locs += ~[ebml_w.writer.tell()];
419419
ebml::start_tag(ebml_w, tag_index_buckets_bucket);
420-
for elt: entry[T] in *bucket {
420+
for elt: entry<T> in *bucket {
421421
ebml::start_tag(ebml_w, tag_index_buckets_bucket_elt);
422422
writer.write_be_uint(elt.pos, 4u);
423423
write_fn(writer, elt.val);

0 commit comments

Comments
 (0)