Skip to content

Commit 76c3297

Browse files
committed
---
yaml --- r: 44861 b: refs/heads/master c: 4c35a00 h: refs/heads/master i: 44859: 6828587 v: v3
1 parent 0ac12ba commit 76c3297

File tree

7 files changed

+21
-30
lines changed

7 files changed

+21
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ca9549bdfc3dd969e9182d58038f90bbef026ded
2+
refs/heads/master: 4c35a0089377bc8572ad0fe356c64e00ed16c51b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/librustc/middle/trans/callee.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use middle::trans::inline;
3939
use middle::trans::meth;
4040
use middle::trans::monomorphize;
4141
use middle::trans::type_of;
42+
use middle::ty::ty_to_str;
4243
use middle::ty;
4344
use middle::typeck;
4445
use util::common::indenter;
@@ -730,7 +731,7 @@ pub fn trans_arg_expr(bcx: block,
730731

731732
ast::by_copy => {
732733
debug!("by copy arg with type %s, storing to scratch",
733-
bcx.ty_to_str(arg_datum.ty));
734+
ty_to_str(ccx.tcx, arg_datum.ty));
734735
let scratch = scratch_datum(bcx, arg_datum.ty, false);
735736

736737
arg_datum.store_to_datum(bcx, arg_expr.id,

trunk/src/libsyntax/ext/auto_encode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ fn mk_impl(
460460
let ty = cx.ty_path(
461461
span,
462462
~[ident],
463-
opt_vec::take_vec(generics.ty_params.map(
464-
|tp| cx.ty_path(span, ~[tp.ident], ~[])))
463+
generics.ty_params.map(
464+
|tp| cx.ty_path(span, ~[tp.ident], ~[])).to_vec()
465465
);
466466

467467
let generics = ast::Generics {

trunk/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,13 @@ impl ext_ctxt_ast_builder for ext_ctxt {
394394
}
395395

396396
fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> ~[@ast::Ty] {
397-
opt_vec::take_vec(
398-
ty_params.map(|p| self.ty_path_ast_builder(
399-
path(~[p.ident], dummy_sp()))))
397+
ty_params.map(|p| self.ty_path_ast_builder(
398+
path(~[p.ident], dummy_sp()))).to_vec()
400399
}
401400

402401
fn ty_vars_global(&self,
403402
ty_params: &OptVec<ast::TyParam>) -> ~[@ast::Ty] {
404-
opt_vec::take_vec(
405-
ty_params.map(|p| self.ty_path_ast_builder(
406-
path(~[p.ident], dummy_sp()))))
403+
ty_params.map(|p| self.ty_path_ast_builder(
404+
path(~[p.ident], dummy_sp()))).to_vec()
407405
}
408406
}

trunk/src/libsyntax/opt_vec.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ pub fn with<T>(+t: T) -> OptVec<T> {
3131
Vec(~[t])
3232
}
3333

34-
pub fn from<T>(+t: ~[T]) -> OptVec<T> {
35-
if t.len() == 0 {
36-
Empty
37-
} else {
38-
Vec(t)
39-
}
40-
}
41-
4234
impl<T> OptVec<T> {
4335
fn push(&mut self, +t: T) {
4436
match *self {
@@ -78,12 +70,12 @@ impl<T> OptVec<T> {
7870
Vec(ref v) => v.len()
7971
}
8072
}
81-
}
8273

83-
pub fn take_vec<T>(+v: OptVec<T>) -> ~[T] {
84-
match v {
85-
Empty => ~[],
86-
Vec(v) => v
74+
pure fn to_vec(self) -> ~[T] {
75+
match self {
76+
Empty => ~[],
77+
Vec(v) => v
78+
}
8779
}
8880
}
8981

trunk/src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ pub impl Parser {
11571157
let remaining_exprs =
11581158
self.parse_seq_to_end(token::RBRACKET,
11591159
seq_sep_trailing_allowed(token::COMMA),
1160-
|p| p.parse_expr());
1160+
|p| p.parse_expr()).to_vec();
11611161
ex = expr_vec(~[first_expr] + remaining_exprs, mutbl);
11621162
} else {
11631163
// Vector with one element.
@@ -1419,7 +1419,7 @@ pub impl Parser {
14191419
vec::append(
14201420
self.parse_seq_to_before_end(
14211421
ket, seq_sep_none(),
1422-
|p| p.parse_token_tree()),
1422+
|p| p.parse_token_tree()).to_vec(),
14231423
// the close delimiter:
14241424
~[parse_any_tt_tok(self)])))
14251425
}
@@ -2727,7 +2727,7 @@ pub impl Parser {
27272727
let result = self.parse_seq_to_gt(
27282728
Some(token::COMMA),
27292729
|p| p.parse_ty(false));
2730-
opt_vec::take_vec(result)
2730+
result.to_vec()
27312731
}
27322732

27332733
fn parse_fn_decl(parse_arg_fn: fn(Parser) -> arg_or_capture_item)
@@ -2819,7 +2819,7 @@ pub impl Parser {
28192819
args_or_capture_items =
28202820
self.parse_seq_to_before_end(token::RPAREN,
28212821
sep,
2822-
parse_arg_fn);
2822+
parse_arg_fn).to_vec();
28232823
}
28242824
token::RPAREN => {
28252825
args_or_capture_items = ~[];
@@ -2835,7 +2835,7 @@ pub impl Parser {
28352835
args_or_capture_items =
28362836
self.parse_seq_to_before_end(token::RPAREN,
28372837
sep,
2838-
parse_arg_fn);
2838+
parse_arg_fn).to_vec();
28392839
}
28402840

28412841
self.expect(token::RPAREN);
@@ -3032,7 +3032,7 @@ pub impl Parser {
30323032
fn parse_trait_ref_list(ket: token::Token) -> ~[@trait_ref] {
30333033
self.parse_seq_to_before_end(
30343034
ket, seq_sep_none(),
3035-
|p| p.parse_trait_ref())
3035+
|p| p.parse_trait_ref()).to_vec()
30363036
}
30373037

30383038
fn parse_item_struct() -> item_info {

trunk/src/snapshots.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
S 2013-02-27 a6d9689
2-
freebsd-x86_64 d33b5ebbf3335f6a8a5cc23572f630ad66539830
2+
freebsd-x86_64 683f329fe589af854f9a375405468691d98015ac
33
linux-i386 22f5c2a91941735007ed804586fc0f0e82fc3601
44
linux-x86_64 328fb144edbed8cabb8c2c6306304e3d8460ef60
55
macos-i386 5dda51347f9aba4c70a0890d3ec084d98a49c015

0 commit comments

Comments
 (0)