Skip to content

Commit 618a641

Browse files
ericktgraydon
authored andcommitted
---
yaml --- r: 4739 b: refs/heads/master c: 4abc471 h: refs/heads/master i: 4737: aa1a4b2 4735: e82535e v: v3
1 parent b36b952 commit 618a641

File tree

21 files changed

+78
-78
lines changed

21 files changed

+78
-78
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: 4c9049c50c5c32f556eaefbcc50209ef8ee353d0
2+
refs/heads/master: 4abc471390d897e97e07eafcb723a8dcb59c520f

trunk/src/comp/driver/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fn parse_input_src(sess: session::session, cfg: &ast::crate_cfg,
110110
ret {crate: crate, src: src};
111111
}
112112

113-
fn time[T](do_it: bool, what: str, thunk: fn() -> T ) -> T {
113+
fn time<T>(do_it: bool, what: str, thunk: fn() -> T ) -> T {
114114
if !do_it { ret thunk(); }
115115
let start = std::time::precise_time_s();
116116
let rv = thunk();

trunk/src/comp/front/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/metadata/encoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn encode_def_id(ebml_w: &ebml::writer, id: &def_id) {
3636
ebml::end_tag(ebml_w);
3737
}
3838

39-
type entry[T] = {val: T, pos: uint};
39+
type entry<T> = {val: T, pos: uint};
4040

4141
fn encode_tag_variant_paths(ebml_w: &ebml::writer, variants: &[variant],
4242
path: &[str], index: &mutable [entry<str>]) {
@@ -392,7 +392,7 @@ 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 ) ->
395+
fn create_index<T>(index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
396396
[@[entry<T>]] {
397397
let buckets: [@mutable [entry<T>]] = ~[];
398398
for each i: uint in uint::range(0u, 256u) { buckets += ~[@mutable ~[]]; }
@@ -408,7 +408,7 @@ fn create_index[T](index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
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);

trunk/src/comp/metadata/tydecode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn parse_path(st: @pstate, sd: str_def) -> ast::path {
115115
fail "parse_path: ill-formed path";
116116
}
117117

118-
type arg_parser[T] = fn(@pstate, str_def) -> ast::constr_arg_general_<T> ;
118+
type arg_parser<T> = fn(@pstate, str_def) -> ast::constr_arg_general_<T> ;
119119

120120
fn parse_constr_arg(st: @pstate, sd: str_def) -> ast::fn_constr_arg {
121121
alt peek(st) as char {
@@ -150,7 +150,7 @@ fn parse_ty_constr_arg(st: @pstate, sd: str_def) ->
150150
}
151151
}
152152

153-
fn parse_constr[@T](st: @pstate, sd: str_def, pser: arg_parser<T>) ->
153+
fn parse_constr<@T>(st: @pstate, sd: str_def, pser: arg_parser<T>) ->
154154
@ty::constr_general<T> {
155155
let sp = ast::dummy_sp(); // FIXME: use a real span
156156
let args: [@sp_constr_arg<T>] = ~[];

trunk/src/comp/middle/ast_map.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn map_expr(map: &map, ex: &@expr, e: &(), v: &vt<()>) {
4848
visit::visit_expr(ex, e, v);
4949
}
5050

51-
fn new_smallintmap_int_adapter[@V]() -> std::map::hashmap<int, V> {
51+
fn new_smallintmap_int_adapter<@V>() -> std::map::hashmap<int, V> {
5252
let key_idx = fn (key: &int) -> uint { key as uint };
5353
let idx_key = fn (idx: &uint) -> int { idx as int };
5454
ret new_smallintmap_adapter(key_idx, idx_key);
@@ -59,13 +59,13 @@ fn new_smallintmap_int_adapter[@V]() -> std::map::hashmap<int, V> {
5959
// the entire codebase adapting all the callsites to the different
6060
// interface.
6161
// FIXME: hashmap and smallintmap should support the same interface.
62-
fn new_smallintmap_adapter[@K,
63-
@V](key_idx: fn(&K) -> uint ,
62+
fn new_smallintmap_adapter<@K,
63+
@V>(key_idx: fn(&K) -> uint ,
6464
idx_key: fn(&uint) -> K ) ->
6565
std::map::hashmap<K, V> {
6666

67-
obj adapter[@K,
68-
@V](map: smallintmap::smallintmap<V>,
67+
obj adapter<@K,
68+
@V>(map: smallintmap::smallintmap<V>,
6969
key_idx: fn(&K) -> uint ,
7070
idx_key: fn(&uint) -> K ) {
7171

trunk/src/comp/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ fn add_name(ch: &checker, sp: &span, name: &ident) {
13921392

13931393
fn ident_id(i: &ident) -> ident { ret i; }
13941394

1395-
fn ensure_unique[T](e: &env, sp: &span, elts: &[T], id: fn(&T) -> ident ,
1395+
fn ensure_unique<T>(e: &env, sp: &span, elts: &[T], id: fn(&T) -> ident ,
13961396
kind: &str) {
13971397
let ch = checker(e, kind);
13981398
for elt: T in elts { add_name(ch, sp, id(elt)); }

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,13 @@ fn non_init_constraint_mentions(fcx: &fn_ctxt, c: &norm_constraint,
10121012
};
10131013
}
10141014

1015-
fn args_mention[T](args: &[@constr_arg_use], q: fn(&[T], node_id) -> bool ,
1015+
fn args_mention<T>(args: &[@constr_arg_use], q: fn(&[T], node_id) -> bool ,
10161016
s: &[T]) -> bool {
10171017
/*
10181018
FIXME
10191019
The following version causes an assertion in trans to fail
10201020
(something about type_is_tup_like)
1021-
fn mentions[T](&[T] s, &fn(&[T], def_id) -> bool q,
1021+
fn mentions<T>(&[T] s, &fn(&[T], def_id) -> bool q,
10221022
&@constr_arg_use a) -> bool {
10231023
alt (a.node) {
10241024
case (carg_ident(?p1)) {
@@ -1051,7 +1051,7 @@ fn op_to_oper_ty(io: init_op) -> oper_type {
10511051
}
10521052

10531053
// default function visitor
1054-
fn do_nothing[T](f: &_fn, tp: &[ty_param], sp: &span, i: &fn_ident,
1054+
fn do_nothing<T>(f: &_fn, tp: &[ty_param], sp: &span, i: &fn_ident,
10551055
iid: node_id, cx: &T, v: &visit::vt<T>) {
10561056
}
10571057

trunk/src/comp/middle/ty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ tag sty {
284284

285285
// In the middle end, constraints have a def_id attached, referring
286286
// to the definition of the operator in the constraint.
287-
type constr_general[ARG] = spanned<constr_general_<ARG, def_id>>;
287+
type constr_general<ARG> = spanned<constr_general_<ARG, def_id>>;
288288
type type_constr = constr_general<path>;
289289
type constr = constr_general<uint>;
290290

@@ -1554,7 +1554,7 @@ fn hash_ty(typ: &t) -> uint { ret typ; }
15541554
// users should use `eq_ty()` instead.
15551555
fn eq_int(x: &uint, y: &uint) -> bool { ret x == y; }
15561556

1557-
fn arg_eq[T](eq: &fn(&T, &T) -> bool , a: @sp_constr_arg<T>,
1557+
fn arg_eq<T>(eq: &fn(&T, &T) -> bool , a: @sp_constr_arg<T>,
15581558
b: @sp_constr_arg<T>) -> bool {
15591559
alt a.node {
15601560
ast::carg_base. {
@@ -1569,7 +1569,7 @@ fn arg_eq[T](eq: &fn(&T, &T) -> bool , a: @sp_constr_arg<T>,
15691569
}
15701570
}
15711571

1572-
fn args_eq[T](eq: fn(&T, &T) -> bool , a: &[@sp_constr_arg<T>],
1572+
fn args_eq<T>(eq: fn(&T, &T) -> bool , a: &[@sp_constr_arg<T>],
15731573
b: &[@sp_constr_arg<T>]) -> bool {
15741574
let i: uint = 0u;
15751575
for arg: @sp_constr_arg<T> in a {
@@ -3090,7 +3090,7 @@ fn is_binopable(cx: &ctxt, ty: t, op: ast::binop) -> bool {
30903090
ret tbl.(tycat(cx, ty)).(opcat(op));
30913091
}
30923092

3093-
fn ast_constr_to_constr[T](tcx: ty::ctxt, c: &@ast::constr_general<T>) ->
3093+
fn ast_constr_to_constr<T>(tcx: ty::ctxt, c: &@ast::constr_general<T>) ->
30943094
@ty::constr_general<T> {
30953095
alt tcx.def_map.find(c.node.id) {
30963096
some(ast::def_fn(pred_id, ast::pure_fn.)) {

trunk/src/comp/middle/typeck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,10 +1281,10 @@ fn gather_locals(ccx: &@crate_ctxt, f: &ast::_fn, id: &ast::node_id,
12811281
};
12821282

12831283
// Don't descend into fns and items
1284-
fn visit_fn[E](f: &ast::_fn, tp: &[ast::ty_param], sp: &span,
1284+
fn visit_fn<E>(f: &ast::_fn, tp: &[ast::ty_param], sp: &span,
12851285
i: &ast::fn_ident, id: ast::node_id, e: &E,
12861286
v: &visit::vt<E>) { }
1287-
fn visit_item[E](i: &@ast::item, e: &E, v: &visit::vt<E>) { }
1287+
fn visit_item<E>(i: &@ast::item, e: &E, v: &visit::vt<E>) { }
12881288

12891289
let visit =
12901290
@{visit_local: visit_local,

trunk/src/comp/syntax/ast.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import std::str;
55
import codemap::span;
66
import codemap::filename;
77

8-
type spanned[T] = {node: T, span: span};
9-
fn respan[T](sp: &span, t: &T) -> spanned<T> { ret {node: t, span: sp}; }
8+
type spanned<T> = {node: T, span: span};
9+
fn respan<T>(sp: &span, t: &T) -> spanned<T> { ret {node: t, span: sp}; }
1010

1111
/* assuming that we're not in macro expansion */
1212
fn mk_sp(lo: uint, hi: uint) -> span {
@@ -468,10 +468,10 @@ so that the typestate pass doesn't have to map a function name onto its decl.
468468
So, the constr_arg type is parameterized: it's instantiated with uint for
469469
declarations, and ident for uses.
470470
*/
471-
tag constr_arg_general_[T] { carg_base; carg_ident(T); carg_lit(@lit); }
471+
tag constr_arg_general_<T> { carg_base; carg_ident(T); carg_lit(@lit); }
472472

473473
type fn_constr_arg = constr_arg_general_<uint>;
474-
type sp_constr_arg[T] = spanned<constr_arg_general_<T>>;
474+
type sp_constr_arg<T> = spanned<constr_arg_general_<T>>;
475475
type ty_constr_arg = sp_constr_arg<path>;
476476
type constr_arg = spanned<fn_constr_arg>;
477477

@@ -480,12 +480,12 @@ type constr_arg = spanned<fn_constr_arg>;
480480
// The implicit root of such path, in the constraint-list for a
481481
// constrained type, is * (referring to the base record)
482482

483-
type constr_general_[ARG, ID] =
483+
type constr_general_<ARG, ID> =
484484
{path: path, args: [@spanned<constr_arg_general_<ARG>>], id: ID};
485485

486486
// In the front end, constraints have a node ID attached.
487487
// Typeck turns this to a def_id, using the output of resolve.
488-
type constr_general[ARG] = spanned<constr_general_<ARG, node_id>>;
488+
type constr_general<ARG> = spanned<constr_general_<ARG, node_id>>;
489489
type constr_ = constr_general_<uint, node_id>;
490490
type constr = spanned<constr_general_<uint, node_id>>;
491491
type ty_constr_ = ast::constr_general_<ast::path, ast::node_id>;

trunk/src/comp/syntax/ext/simplext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn path_to_ident(pth: &path) -> option::t<ident> {
4343
type clause = {params: binders, body: @expr};
4444

4545
/* logically, an arb_depth should contain only one kind of matchable */
46-
tag arb_depth[T] { leaf(T); seq(@[arb_depth<T>], span); }
46+
tag arb_depth<T> { leaf(T); seq(@[arb_depth<T>], span); }
4747

4848

4949
tag matchable {
@@ -121,7 +121,7 @@ fn elts_to_ell(cx: &ext_ctxt, elts: &[@expr])
121121
}
122122
}
123123

124-
fn option_flatten_map[T, U](f: &fn(&T) -> option::t<U>, v: &[T]) ->
124+
fn option_flatten_map<T, U>(f: &fn(&T) -> option::t<U>, v: &[T]) ->
125125
option::t<[U]> {
126126
let res = ~[];
127127
for elem: T in v {

trunk/src/comp/syntax/fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type a_f =
7575
new_span: fn(&span) -> span};
7676

7777

78-
//fn nf_dummy[T](&T node) -> T { fail; }
78+
//fn nf_dummy<T>(&T node) -> T { fail; }
7979
fn nf_crate_dummy(c: &crate) -> crate { fail; }
8080
fn nf_crate_directive_dummy(c: &@crate_directive) -> @crate_directive {
8181
fail;

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ fn expect_gt(p: &parser) {
224224
}
225225
}
226226

227-
fn spanned[T](lo: uint, hi: uint, node: &T) -> spanned<T> {
227+
fn spanned<T>(lo: uint, hi: uint, node: &T) -> spanned<T> {
228228
ret {node: node, span: ast::mk_sp(lo, hi)};
229229
}
230230

@@ -429,7 +429,7 @@ fn parse_constr_in_type(p: &parser) -> @ast::ty_constr {
429429
}
430430

431431

432-
fn parse_constrs[T](pser: fn(&parser) -> @ast::constr_general<T>, p: &parser)
432+
fn parse_constrs<T>(pser: fn(&parser) -> @ast::constr_general<T>, p: &parser)
433433
-> [@ast::constr_general<T>] {
434434
let constrs: [@ast::constr_general<T>] = ~[];
435435
while true {
@@ -643,7 +643,7 @@ fn parse_fn_block_arg(p: &parser) -> ast::arg {
643643
ret {mode: m, ty: t, ident: i, id: p.get_id()};
644644
}
645645

646-
fn parse_seq_to_before_gt[T](sep: option::t<token::token>,
646+
fn parse_seq_to_before_gt<T>(sep: option::t<token::token>,
647647
f: fn(&parser) -> T, p: &parser) -> [T] {
648648
let first = true;
649649
let v = ~[];
@@ -660,15 +660,15 @@ fn parse_seq_to_before_gt[T](sep: option::t<token::token>,
660660
ret v;
661661
}
662662

663-
fn parse_seq_to_gt[T](sep: option::t<token::token>, f: fn(&parser) -> T,
663+
fn parse_seq_to_gt<T>(sep: option::t<token::token>, f: fn(&parser) -> T,
664664
p: &parser) -> [T] {
665665
let v = parse_seq_to_before_gt(sep, f, p);
666666
expect_gt(p);
667667

668668
ret v;
669669
}
670670

671-
fn parse_seq_lt_gt[T](sep: option::t<token::token>, f: fn(&parser) -> T,
671+
fn parse_seq_lt_gt<T>(sep: option::t<token::token>, f: fn(&parser) -> T,
672672
p: &parser) -> spanned<[T]> {
673673
let lo = p.get_lo_pos();
674674
expect(p, token::LT);
@@ -678,14 +678,14 @@ fn parse_seq_lt_gt[T](sep: option::t<token::token>, f: fn(&parser) -> T,
678678
ret spanned(lo, hi, result);
679679
}
680680

681-
fn parse_seq_to_end[T](ket: token::token, sep: option::t<token::token>,
681+
fn parse_seq_to_end<T>(ket: token::token, sep: option::t<token::token>,
682682
f: fn(&parser) -> T , p: &parser) -> [T] {
683683
let val = parse_seq_to_before_end(ket, sep, f, p);
684684
p.bump();
685685
ret val;
686686
}
687687

688-
fn parse_seq_to_before_end[T](ket: token::token, sep: option::t<token::token>,
688+
fn parse_seq_to_before_end<T>(ket: token::token, sep: option::t<token::token>,
689689
f: fn(&parser) -> T , p: &parser) -> [T] {
690690
let first: bool = true;
691691
let v: [T] = ~[];
@@ -700,7 +700,7 @@ fn parse_seq_to_before_end[T](ket: token::token, sep: option::t<token::token>,
700700
}
701701

702702

703-
fn parse_seq[T](bra: token::token, ket: token::token,
703+
fn parse_seq<T>(bra: token::token, ket: token::token,
704704
sep: option::t<token::token>, f: fn(&parser) -> T ,
705705
p: &parser) -> spanned<[T]> {
706706
let lo = p.get_lo_pos();

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn synth_comment(s: &ps, text: str) {
217217
word(s.s, "*/");
218218
}
219219

220-
fn commasep[IN](s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ) {
220+
fn commasep<IN>(s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ) {
221221
box(s, 0u, b);
222222
let first = true;
223223
for elt: IN in elts {
@@ -228,7 +228,7 @@ fn commasep[IN](s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ) {
228228
}
229229

230230

231-
fn commasep_cmnt[IN](s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ,
231+
fn commasep_cmnt<IN>(s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ,
232232
get_span: fn(&IN) -> codemap::span ) {
233233
box(s, 0u, b);
234234
let len = vec::len[IN](elts);
@@ -1515,7 +1515,7 @@ fn escape_str(st: str, to_escape: char) -> str {
15151515
ret out;
15161516
}
15171517

1518-
fn to_str[T](t: &T, f: fn(&ps, &T) ) -> str {
1518+
fn to_str<T>(t: &T, f: fn(&ps, &T) ) -> str {
15191519
let writer = io::string_writer();
15201520
let s = rust_printer(writer.get_writer());
15211521
f(s, t);
@@ -1536,7 +1536,7 @@ fn next_comment(s: &ps) -> option::t<lexer::cmnt> {
15361536

15371537
// Removing the aliases from the type of f in the next two functions
15381538
// triggers memory corruption, but I haven't isolated the bug yet. FIXME
1539-
fn constr_args_to_str[T](f: &fn(&T) -> str ,
1539+
fn constr_args_to_str<T>(f: &fn(&T) -> str ,
15401540
args: &[@ast::sp_constr_arg<T>]) -> str {
15411541
let comma = false;
15421542
let s = "(";
@@ -1548,7 +1548,7 @@ fn constr_args_to_str[T](f: &fn(&T) -> str ,
15481548
ret s;
15491549
}
15501550

1551-
fn constr_arg_to_str[T](f: &fn(&T) -> str, c: &ast::constr_arg_general_<T>)
1551+
fn constr_arg_to_str<T>(f: &fn(&T) -> str, c: &ast::constr_arg_general_<T>)
15521552
-> str {
15531553
alt c {
15541554
ast::carg_base. { ret "*"; }

trunk/src/comp/syntax/untyped_ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ fn dummy() {
370370
extract_fn(ctx, elts.(idx))]];
371371
}
372372

373-
fn seq_cv[T](conversion: fn (&ctx, &@ast_node) -> T)
373+
fn seq_cv<T>(conversion: fn (&ctx, &@ast_node) -> T)
374374
-> fn (&ctx, @ast_node) -> T[] {
375375
ret lambda(ctx: &ctx, ut: @ast_node) -> T[] {
376376
ret alt *ut {
@@ -383,7 +383,7 @@ fn seq_cv[T](conversion: fn (&ctx, &@ast_node) -> T)
383383
}
384384
}
385385

386-
fn opt_cv[T](conversion: fn (&ctx, &@ast_node) -> T)
386+
fn opt_cv<T>(conversion: fn (&ctx, &@ast_node) -> T)
387387
-> fn (&ctx, @ast_node) -> option::t<T> {
388388
ret lambda(ctx: &ctx, ut: @ast_node) -> option::t<T> {
389389
ret alt *ut {

0 commit comments

Comments
 (0)