Skip to content

Commit 979d3a5

Browse files
committed
Correct merge failures
1 parent ce602c6 commit 979d3a5

File tree

14 files changed

+34
-85
lines changed

14 files changed

+34
-85
lines changed

src/libextra/fileinput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ mod test {
418418
fn make_file(path : &Path, contents: &[~str]) {
419419
let file = io::file_writer(path, [io::Create, io::Truncate]).get();
420420

421-
for contents.iter().advance |&str| {
421+
for contents.iter().advance |str| {
422422
file.write_str(*str);
423423
file.write_char('\n');
424424
}

src/libextra/num/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ mod biguint_tests {
15861586
let &(ref n, ref rs) = num_pair;
15871587
for rs.iter().advance |str_pair| {
15881588
let &(ref radix, ref str) = str_pair;
1589-
assert_eq!(&n, &FromStrRadix::from_str_radix(*str, *radix).get());
1589+
assert_eq!(n, &FromStrRadix::from_str_radix(*str, *radix).get());
15901590
}
15911591
}
15921592

src/libextra/term.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ impl Terminal {
119119
pub fn reset(&self) {
120120
let mut vars = Variables::new();
121121
let s = do self.ti.strings.find_equiv(&("op"))
122-
.map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| {
123-
expand(op, [], &mut vars)
122+
.map_consume_default(Err(~"can't find terminfo capability `op`")) |op| {
123+
expand(copy *op, [], &mut vars)
124124
};
125125
if s.is_ok() {
126126
self.out.write(s.unwrap());

src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ impl GatherLoanCtxt {
617617
*/
618618

619619
let mc_ctxt = self.bccx.mc_ctxt();
620-
for decl.inputs.each |arg| {
620+
for decl.inputs.iter().advance |arg| {
621621
let arg_ty = ty::node_id_to_type(self.tcx(), arg.pat.id);
622622

623623
let arg_cmt = mc_ctxt.cat_rvalue(

src/librustc/middle/moves.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,8 @@ enum UseMode {
190190

191191
pub fn compute_moves(tcx: ty::ctxt,
192192
method_map: method_map,
193-
<<<<<<< HEAD
194193
crate: &crate) -> MoveMaps
195194
{
196-
||||||| merged common ancestors
197-
crate: @crate) -> MoveMaps
198-
{
199-
=======
200-
crate: @crate) -> MoveMaps {
201-
>>>>>>> Modify borrow checker to visit irrefutable patterns that appear in
202195
let visitor = visit::mk_vt(@visit::Visitor {
203196
visit_fn: compute_modes_for_fn,
204197
visit_expr: compute_modes_for_expr,
@@ -248,7 +241,7 @@ fn compute_modes_for_fn(fk: &visit::fn_kind,
248241
id: node_id,
249242
(cx, v): (VisitContext,
250243
vt<VisitContext>)) {
251-
for decl.inputs.each |a| {
244+
for decl.inputs.iter().advance |a| {
252245
cx.use_pat(a.pat);
253246
}
254247
visit::visit_fn(fk, decl, body, span, id, (cx, v));
@@ -554,7 +547,7 @@ impl VisitContext {
554547
}
555548

556549
expr_fn_block(ref decl, ref body) => {
557-
for decl.inputs.each |a| {
550+
for decl.inputs.iter().advance |a| {
558551
self.use_pat(a.pat);
559552
}
560553
let cap_vars = self.compute_captures(expr.id);

src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ pub fn store_local(bcx: block,
17381738
* Generates code for a local variable declaration like
17391739
* `let <pat>;` or `let <pat> = <opt_init_expr>`.
17401740
*/
1741-
let _icx = bcx.insn_ctxt("match::store_local");
1741+
let _icx = push_ctxt("match::store_local");
17421742
let mut bcx = bcx;
17431743

17441744
return match opt_init_expr {
@@ -1813,7 +1813,7 @@ pub fn store_arg(mut bcx: block,
18131813
* if the argument type is `T`, then `llval` is a `T*`). In some
18141814
* cases, this code may zero out the memory `llval` points at.
18151815
*/
1816-
let _icx = bcx.insn_ctxt("match::store_arg");
1816+
let _icx = push_ctxt("match::store_arg");
18171817

18181818
// We always need to cleanup the argument as we exit the fn scope.
18191819
// Note that we cannot do it before for fear of a fn like
@@ -1882,10 +1882,9 @@ fn bind_irrefutable_pat(bcx: block,
18821882
* - binding_mode: is this for an argument or a local variable?
18831883
*/
18841884

1885-
debug!("bind_irrefutable_pat(bcx=%s, pat=%s, val=%s, binding_mode=%?)",
1885+
debug!("bind_irrefutable_pat(bcx=%s, pat=%s, binding_mode=%?)",
18861886
bcx.to_str(),
18871887
pat_to_str(pat, bcx.sess().intr()),
1888-
val_str(bcx.ccx().tn, val),
18891888
binding_mode);
18901889

18911890
if bcx.sess().asm_comments() {
@@ -1895,7 +1894,7 @@ fn bind_irrefutable_pat(bcx: block,
18951894

18961895
let _indenter = indenter();
18971896

1898-
let _icx = bcx.insn_ctxt("alt::bind_irrefutable_pat");
1897+
let _icx = push_ctxt("alt::bind_irrefutable_pat");
18991898
let mut bcx = bcx;
19001899
let tcx = bcx.tcx();
19011900
let ccx = bcx.ccx();

src/librustc/middle/trans/base.rs

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ impl Drop for _InsnCtxt {
112112
fn drop(&self) {
113113
unsafe {
114114
do local_data::local_data_modify(task_local_insn_key) |c| {
115-
do c.map_consume |@ctx| {
116-
let mut ctx = ctx;
115+
do c.map_consume |ctx| {
116+
let mut ctx = copy *ctx;
117117
ctx.pop();
118118
@ctx
119119
}
@@ -126,8 +126,8 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
126126
debug!("new InsnCtxt: %s", s);
127127
unsafe {
128128
do local_data::local_data_modify(task_local_insn_key) |c| {
129-
do c.map_consume |@ctx| {
130-
let mut ctx = ctx;
129+
do c.map_consume |ctx| {
130+
let mut ctx = copy *ctx;
131131
ctx.push(s);
132132
@ctx
133133
}
@@ -1438,54 +1438,6 @@ pub fn block_locals(b: &ast::blk, it: &fn(@ast::local)) {
14381438
}
14391439
}
14401440

1441-
<<<<<<< variant A
1442-
pub fn alloc_local(cx: block, local: &ast::local) -> block {
1443-
let _icx = push_ctxt("alloc_local");
1444-
let t = node_id_type(cx, local.node.id);
1445-
let simple_name = match local.node.pat.node {
1446-
ast::pat_ident(_, ref pth, None) => Some(path_to_ident(pth)),
1447-
_ => None
1448-
};
1449-
let val = alloc_ty(cx, t);
1450-
if cx.sess().opts.debuginfo {
1451-
for simple_name.iter().advance |name| {
1452-
str::as_c_str(cx.ccx().sess.str_of(*name), |buf| {
1453-
unsafe {
1454-
llvm::LLVMSetValueName(val, buf)
1455-
}
1456-
});
1457-
}
1458-
}
1459-
cx.fcx.lllocals.insert(local.node.id, val);
1460-
cx
1461-
}
1462-
1463-
1464-
>>>>>>> variant B
1465-
####### Ancestor
1466-
pub fn alloc_local(cx: block, local: @ast::local) -> block {
1467-
let _icx = push_ctxt("alloc_local");
1468-
let t = node_id_type(cx, local.node.id);
1469-
let simple_name = match local.node.pat.node {
1470-
ast::pat_ident(_, pth, None) => Some(path_to_ident(pth)),
1471-
_ => None
1472-
};
1473-
let val = alloc_ty(cx, t);
1474-
if cx.sess().opts.debuginfo {
1475-
for simple_name.iter().advance |name| {
1476-
str::as_c_str(cx.ccx().sess.str_of(*name), |buf| {
1477-
unsafe {
1478-
llvm::LLVMSetValueName(val, buf)
1479-
}
1480-
});
1481-
}
1482-
}
1483-
cx.fcx.lllocals.insert(local.node.id, val);
1484-
cx
1485-
}
1486-
1487-
1488-
======= end
14891441
pub fn with_cond(bcx: block, val: ValueRef, f: &fn(block) -> block) -> block {
14901442
let _icx = push_ctxt("with_cond");
14911443
let next_cx = base::sub_block(bcx, "next");
@@ -1763,7 +1715,7 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
17631715
let self_val = if slf.is_copy
17641716
&& datum::appropriate_mode(bcx.tcx(), slf.t).is_by_value() {
17651717
let tmp = BitCast(bcx, slf.v, type_of(bcx.ccx(), slf.t));
1766-
let alloc = alloc_ty(bcx, slf.t);
1718+
let alloc = alloc_ty(bcx, slf.t, "__self");
17671719
Store(bcx, tmp, alloc);
17681720
alloc
17691721
} else {
@@ -3030,7 +2982,7 @@ pub fn trans_crate(sess: session::Session,
30302982
}
30312983
}
30322984
if ccx.sess.count_llvm_insns() {
3033-
for ccx.stats.llvm_insns.each |k, v| {
2985+
for ccx.stats.llvm_insns.iter().advance |(k, v)| {
30342986
io::println(fmt!("%-7u %s", *v, *k));
30352987
}
30362988
}

src/librustc/middle/trans/callee.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,10 @@ pub fn trans_arg_expr(bcx: block,
873873
// &arg_expr.id);
874874
debug!("by ref arg with type %s, storing to scratch",
875875
bcx.ty_to_str(arg_datum.ty));
876-
let scratch = scratch_datum(bcx, arg_datum.ty, false);
876+
let scratch = scratch_datum(bcx, arg_datum.ty,
877+
"__self", false);
877878

878879
arg_datum.store_to_datum(bcx,
879-
arg_expr.id,
880880
INIT,
881881
scratch);
882882

@@ -897,7 +897,6 @@ pub fn trans_arg_expr(bcx: block,
897897
"__arg", false);
898898

899899
arg_datum.store_to_datum(bcx,
900-
arg_expr.id,
901900
INIT,
902901
scratch);
903902

src/librustc/middle/trans/meth.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,8 @@ pub fn trans_trait_callee_from_llval(bcx: block,
614614
}
615615

616616
llself = PointerCast(bcx, llself, Type::opaque_box(ccx).ptr_to());
617-
let scratch = scratch_datum(bcx, ty::mk_opaque_box(bcx.tcx()), false);
617+
let scratch = scratch_datum(bcx, ty::mk_opaque_box(bcx.tcx()),
618+
"__trait_callee", false);
618619
Store(bcx, llself, scratch.val);
619620
scratch.add_clean(bcx);
620621

src/libstd/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ impl<T> OwnedVector<T> for ~[T] {
12761276
ln => {
12771277
let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]);
12781278
unsafe {
1279-
raw::set_len(v, ln - 1u);
1279+
raw::set_len(self, ln - 1u);
12801280
ptr::read_ptr(valptr)
12811281
}
12821282
}
@@ -1408,7 +1408,7 @@ impl<T> OwnedVector<T> for ~[T] {
14081408
unsafe {
14091409
// This loop is optimized out for non-drop types.
14101410
for uint::range(newlen, oldlen) |i| {
1411-
ptr::read_and_zero_ptr(ptr::mut_offset(p, i))
1411+
ptr::read_and_zero_ptr(ptr::mut_offset(p, i));
14121412
}
14131413
}
14141414
}
@@ -1556,7 +1556,7 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
15561556
* Remove consecutive repeated elements from a vector; if the vector is
15571557
* sorted, this removes all duplicates.
15581558
*/
1559-
pub fn dedup<T:Eq>(&mut self) {
1559+
pub fn dedup(&mut self) {
15601560
unsafe {
15611561
// Although we have a mutable reference to `self`, we cannot make
15621562
// *arbitrary* changes. There exists the possibility that this

src/libsyntax/print/pprust.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,12 @@ pub fn print_path(s: @ps, path: &ast::Path, colons_before_params: bool) {
15211521
print_path_(s, path, colons_before_params, &None)
15221522
}
15231523

1524-
pub fn print_pat(s: @ps, pat: &ast::pat) {
1524+
pub fn print_bounded_path(s: @ps, path: &ast::Path,
1525+
bounds: &Option<OptVec<ast::TyParamBound>>) {
1526+
print_path_(s, path, false, bounds)
1527+
}
1528+
1529+
pub fn print_pat(s: @ps, pat: @ast::pat) {
15251530
maybe_print_comment(s, pat.span.lo);
15261531
let ann_node = node_pat(s, pat);
15271532
(s.ann.pre)(ann_node);

src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct S {f:~str}
22
impl Drop for S {
3-
fn finalize(&self) { println(self.f); }
3+
fn drop(&self) { println(self.f); }
44
}
55

66
fn move_in_match() {

src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct S(~str);
22
impl Drop for S {
3-
fn finalize(&self) { println(**self); }
3+
fn drop(&self) { println(**self); }
44
}
55

66
fn move_in_match() {

src/test/run-pass/reflect-visit-type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ pub fn main() {
163163
visit_ty::<i16>(vv);
164164
visit_ty::<~[int]>(vv);
165165

166-
for v.types.iter().advance |&s| {
167-
println(fmt!("type: %s", s));
166+
for v.types.iter().advance |s| {
167+
println(fmt!("type: %s", copy *s));
168168
}
169169
assert_eq!((*v.types).clone(), ~[~"bool", ~"int", ~"i8", ~"i16", ~"[", ~"int", ~"]"]);
170170
}

0 commit comments

Comments
 (0)