Skip to content

Commit 1790263

Browse files
committed
---
yaml --- r: 58683 b: refs/heads/try c: 7aa10e6 h: refs/heads/master i: 58681: ac70f87 58679: 8399355 v: v3
1 parent 0881d5e commit 1790263

30 files changed

+280
-214
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 213f7b24ccd9a6833af7e1a329c5e7ffc8f9e3d2
5-
refs/heads/try: 35b91e2f73cec610af4a2a653389562ad7cbc85e
5+
refs/heads/try: 7aa10e616bc3d4d43051c04a074d7e573fb72886
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/rt.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,16 @@ endif
163163
ifdef CFG_WINDOWSY_$(1)
164164
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
165165
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
166+
CFLAGS="$$(CFG_GCCISH_CFLAGS)" \
167+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS)" \
166168
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
167169
OS=mingw \
168170
V=$$(VERBOSE)
169171
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
170172
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
171173
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
172-
CFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
173-
LDFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1)))" \
174+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
175+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
174176
CC="$$(CC_$(1))" \
175177
CXX="$$(CXX_$(1))" \
176178
AR="$$(AR_$(1))" \
@@ -181,8 +183,8 @@ $$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
181183
else
182184
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
183185
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
184-
CFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
185-
LDFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1)))" \
186+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
187+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
186188
CC="$$(CC_$(1))" \
187189
CXX="$$(CXX_$(1))" \
188190
AR="$$(AR_$(1))" \

branches/try/src/libcore/iterator.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub trait Iterator<A> {
2929
///
3030
/// In the future these will be default methods instead of a utility trait.
3131
pub trait IteratorUtil<A> {
32-
fn chain(self, other: Self) -> ChainIterator<Self>;
32+
fn chain<U: Iterator<A>>(self, other: U) -> ChainIterator<Self, U>;
3333
fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<Self, U>;
3434
// FIXME: #5898: should be called map
3535
fn transform<'r, B>(self, f: &'r fn(A) -> B) -> MapIterator<'r, A, B, Self>;
@@ -50,7 +50,7 @@ pub trait IteratorUtil<A> {
5050
/// In the future these will be default methods instead of a utility trait.
5151
impl<A, T: Iterator<A>> IteratorUtil<A> for T {
5252
#[inline(always)]
53-
fn chain(self, other: T) -> ChainIterator<T> {
53+
fn chain<U: Iterator<A>>(self, other: U) -> ChainIterator<T, U> {
5454
ChainIterator{a: self, b: other, flag: false}
5555
}
5656

@@ -115,13 +115,13 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
115115
}
116116
}
117117

118-
pub struct ChainIterator<T> {
118+
pub struct ChainIterator<T, U> {
119119
priv a: T,
120-
priv b: T,
120+
priv b: U,
121121
priv flag: bool
122122
}
123123

124-
impl<A, T: Iterator<A>> Iterator<A> for ChainIterator<T> {
124+
impl<A, T: Iterator<A>, U: Iterator<A>> Iterator<A> for ChainIterator<T, U> {
125125
#[inline]
126126
fn next(&mut self) -> Option<A> {
127127
if self.flag {
@@ -385,7 +385,7 @@ mod tests {
385385
#[test]
386386
fn test_iterator_chain() {
387387
let xs = [0u, 1, 2, 3, 4, 5];
388-
let ys = [30, 40, 50, 60];
388+
let ys = [30u, 40, 50, 60];
389389
let expected = [0, 1, 2, 3, 4, 5, 30, 40, 50, 60];
390390
let mut it = xs.iter().chain(ys.iter());
391391
let mut i = 0;
@@ -394,6 +394,15 @@ mod tests {
394394
i += 1;
395395
}
396396
assert_eq!(i, expected.len());
397+
398+
let ys = Counter::new(30u, 10).take(4);
399+
let mut it = xs.iter().transform(|&x| x).chain(ys);
400+
let mut i = 0;
401+
for it.advance |x: uint| {
402+
assert_eq!(x, expected[i]);
403+
i += 1;
404+
}
405+
assert_eq!(i, expected.len());
397406
}
398407

399408
#[test]

branches/try/src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub fn build_session_options(binary: @~str,
653653
654654
let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
655655
let mut args = ~[];
656-
for str::each_split_char(*a, ',') |arg| {
656+
for str::each_split_char(*a, ' ') |arg| {
657657
args.push(str::from_slice(arg));
658658
}
659659
args
@@ -760,7 +760,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
760760
optmulti("L", "", "Add a directory to the library search path",
761761
"PATH"),
762762
optflag("", "lib", "Compile a library crate"),
763-
optmulti("", "link-args", "FLAGS is a comma-separated list of flags
763+
optmulti("", "link-args", "FLAGS is a space-separated list of flags
764764
passed to the linker", "FLAGS"),
765765
optflag("", "ls", "List the symbols defined by a library crate"),
766766
optflag("", "no-trans",

branches/try/src/librustc/middle/borrowck/loan.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ pub impl LoanContext {
115115
if cmt.lp.is_none() {
116116
self.bccx.tcx.sess.span_bug(
117117
cmt.span,
118-
"loan() called with non-lendable value");
118+
~"loan() called with non-lendable value");
119119
}
120120

121121
match cmt.cat {
122122
cat_binding(_) | cat_rvalue | cat_special(_) => {
123123
// should never be loanable
124124
self.bccx.tcx.sess.span_bug(
125125
cmt.span,
126-
"rvalue with a non-none lp");
126+
~"rvalue with a non-none lp");
127127
}
128128
cat_local(local_id) | cat_arg(local_id) | cat_self(local_id) => {
129129
// FIXME(#4903)
@@ -188,7 +188,7 @@ pub impl LoanContext {
188188
// Aliased data is simply not lendable.
189189
self.bccx.tcx.sess.span_bug(
190190
cmt.span,
191-
"aliased ptr with a non-none lp");
191+
~"aliased ptr with a non-none lp");
192192
}
193193
}
194194
}

branches/try/src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,11 @@ pub impl BorrowckCtxt {
525525
self.note_and_explain_bckerr(err);
526526
}
527527

528-
fn span_err(&self, s: span, m: &str) {
528+
fn span_err(&self, s: span, m: ~str) {
529529
self.tcx.sess.span_err(s, m);
530530
}
531531

532-
fn span_note(&self, s: span, m: &str) {
532+
fn span_note(&self, s: span, m: ~str) {
533533
self.tcx.sess.span_note(s, m);
534534
}
535535

branches/try/src/librustc/middle/borrowck/preserve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub impl<'self> PreserveCtxt<'self> {
124124
if self.root_managed_data {
125125
self.tcx().sess.span_bug(
126126
cmt.span,
127-
"preserve() called with local and !root_managed_data");
127+
~"preserve() called with local and !root_managed_data");
128128
}
129129
let local_region = self.tcx().region_maps.encl_region(local_id);
130130
self.compare_scope(cmt, local_region)

branches/try/src/librustc/middle/trans/_match.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ pub fn enter_opt<'r>(bcx: block,
557557
struct_id = found_struct_id;
558558
}
559559
_ => {
560-
tcx.sess.span_bug(p.span, "expected enum variant def");
560+
tcx.sess.span_bug(p.span, ~"expected enum \
561+
variant def");
561562
}
562563
}
563564

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,11 +1125,10 @@ pub fn init_local(bcx: block, local: @ast::local) -> block {
11251125
}
11261126

11271127
let llptr = match bcx.fcx.lllocals.find(&local.node.id) {
1128-
Some(&local_mem(v)) => v,
1129-
_ => {
1130-
bcx.tcx().sess.span_bug(local.span,
1131-
"init_local: Someone forgot to document why it's\
1132-
safe to assume local.node.init must be local_mem!");
1128+
Some(&local_mem(v)) => v,
1129+
_ => { bcx.tcx().sess.span_bug(local.span,
1130+
~"init_local: Someone forgot to document why it's\
1131+
safe to assume local.node.init must be local_mem!");
11331132
}
11341133
};
11351134

branches/try/src/librustc/middle/trans/callee.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ pub fn trans_method_call(in_cx: block,
356356
origin)
357357
}
358358
None => {
359-
cx.tcx().sess.span_bug(call_ex.span, "method call expr wasn't in method map")
359+
cx.tcx().sess.span_bug(call_ex.span,
360+
~"method call expr wasn't in \
361+
method map")
360362
}
361363
}
362364
},

branches/try/src/librustc/middle/trans/consts.rs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit)
5858
}
5959
_ => {
6060
cx.sess.span_bug(lit.span,
61-
"floating point literal doesn't have the right type");
61+
~"floating point literal doesn't have the right \
62+
type");
6263
}
6364
}
6465
}
@@ -280,7 +281,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
280281
else { llvm::LLVMConstURem(te1, te2) }
281282
}
282283
ast::and |
283-
ast::or => cx.sess.span_unimpl(e.span, "binop logic"),
284+
ast::or => cx.sess.span_unimpl(e.span, ~"binop logic"),
284285
ast::bitxor => llvm::LLVMConstXor(te1, te2),
285286
ast::bitand => llvm::LLVMConstAnd(te1, te2),
286287
ast::bitor => llvm::LLVMConstOr(te1, te2),
@@ -294,7 +295,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
294295
ast::le |
295296
ast::ne |
296297
ast::ge |
297-
ast::gt => cx.sess.span_unimpl(e.span, "binop comparator")
298+
ast::gt => cx.sess.span_unimpl(e.span, ~"binop comparator")
298299
}
299300
}
300301
ast::expr_unary(u, e) => {
@@ -343,7 +344,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
343344
const_eval::const_int(i) => i as u64,
344345
const_eval::const_uint(u) => u,
345346
_ => cx.sess.span_bug(index.span,
346-
"index is not an integer-constant expression")
347+
~"index is not an integer-constant \
348+
expression")
347349
};
348350
let (arr, len) = match ty::get(bt).sty {
349351
ty::ty_evec(_, vstore) | ty::ty_estr(vstore) =>
@@ -361,10 +363,12 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
361363
unit_sz))
362364
},
363365
_ => cx.sess.span_bug(base.span,
364-
"index-expr base must be fixed-size or slice")
366+
~"index-expr base must be \
367+
fixed-size or slice")
365368
},
366369
_ => cx.sess.span_bug(base.span,
367-
"index-expr base must be a vector or string type")
370+
~"index-expr base must be \
371+
a vector or string type")
368372
};
369373

370374
let len = llvm::LLVMConstIntGetZExtValue(len) as u64;
@@ -376,7 +380,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
376380
// FIXME #3170: report this earlier on in the const-eval
377381
// pass. Reporting here is a bit late.
378382
cx.sess.span_err(e.span,
379-
"const index-expr is out of bounds");
383+
~"const index-expr is out of bounds");
380384
}
381385
const_get_elt(cx, arr, [iv as c_uint])
382386
}
@@ -450,7 +454,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
450454
match fs.find(|f| field_ty.ident == f.node.ident) {
451455
Some(ref f) => const_expr(cx, (*f).node.expr),
452456
None => {
453-
cx.tcx.sess.span_bug(e.span, "missing struct field");
457+
cx.tcx.sess.span_bug(
458+
e.span, ~"missing struct field");
454459
}
455460
}
456461
});
@@ -466,7 +471,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
466471
ast::expr_lit(ref lit) => {
467472
match lit.node {
468473
ast::lit_str(*) => { const_expr(cx, sub) }
469-
_ => { cx.sess.span_bug(e.span, "bad const-slice lit") }
474+
_ => { cx.sess.span_bug(e.span,
475+
~"bad const-slice lit") }
470476
}
471477
}
472478
ast::expr_vec(ref es, ast::m_imm) => {
@@ -481,7 +487,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
481487
let p = const_ptrcast(cx, gv, llunitty);
482488
C_struct(~[p, sz])
483489
}
484-
_ => cx.sess.span_bug(e.span, "bad const-slice expr")
490+
_ => cx.sess.span_bug(e.span,
491+
~"bad const-slice expr")
485492
}
486493
}
487494
ast::expr_path(pth) => {
@@ -513,7 +520,8 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
513520
C_null(llty)
514521
}
515522
_ => {
516-
cx.sess.span_bug(e.span, "expected a const, fn, struct, or variant def")
523+
cx.sess.span_bug(e.span, ~"expected a const, fn, \
524+
struct, or variant def")
517525
}
518526
}
519527
}
@@ -534,12 +542,13 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
534542
adt::trans_const(cx, repr, vinfo.disr_val,
535543
args.map(|a| const_expr(cx, *a)))
536544
}
537-
_ => cx.sess.span_bug(e.span, "expected a struct or variant def")
545+
_ => cx.sess.span_bug(e.span, ~"expected a struct or \
546+
variant def")
538547
}
539548
}
540549
ast::expr_paren(e) => { return const_expr(cx, e); }
541550
_ => cx.sess.span_bug(e.span,
542-
"bad constant expression type in consts::const_expr")
551+
~"bad constant expression type in consts::const_expr")
543552
};
544553
}
545554
}

branches/try/src/librustc/middle/trans/datum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,8 @@ pub impl Datum {
761761
match self.try_deref(bcx, expr.id, derefs, false) {
762762
(Some(lvres), bcx) => DatumBlock { bcx: bcx, datum: lvres },
763763
(None, _) => {
764-
bcx.ccx().sess.span_bug(expr.span,
765-
"Cannot deref this expression");
764+
bcx.ccx().sess.span_bug(
765+
expr.span, ~"Cannot deref this expression");
766766
}
767767
}
768768
}

0 commit comments

Comments
 (0)