Skip to content

Commit 0c6d02f

Browse files
committed
Correct merge errors
1 parent b5fc4ae commit 0c6d02f

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,7 @@ pub fn store_arg(mut bcx: block,
18421842

18431843
fn mk_binding_alloca(mut bcx: block,
18441844
p_id: ast::node_id,
1845-
path: @ast::Path,
1845+
path: &ast::Path,
18461846
binding_mode: IrrefutablePatternBindingMode,
18471847
populate: &fn(block, ty::t, ValueRef) -> block) -> block {
18481848
let var_ty = node_id_type(bcx, p_id);
@@ -1899,7 +1899,7 @@ fn bind_irrefutable_pat(bcx: block,
18991899
let tcx = bcx.tcx();
19001900
let ccx = bcx.ccx();
19011901
match pat.node {
1902-
ast::pat_ident(pat_binding_mode, path, inner) => {
1902+
ast::pat_ident(pat_binding_mode, ref path, inner) => {
19031903
if pat_is_binding(tcx.def_map, pat) {
19041904
// Allocate the stack slot where the value of this
19051905
// binding will live and place it into the appropriate
@@ -2017,9 +2017,9 @@ fn bind_irrefutable_pat(bcx: block,
20172017
return bcx;
20182018
}
20192019

2020-
fn simple_identifier(pat: @ast::pat) -> Option<@ast::Path> {
2020+
fn simple_identifier<'a>(pat: &'a ast::pat) -> Option<&'a ast::Path> {
20212021
match pat.node {
2022-
ast::pat_ident(ast::bind_infer, path, None) => {
2022+
ast::pat_ident(ast::bind_infer, ref path, None) => {
20232023
Some(path)
20242024
}
20252025
_ => {

src/librustc/middle/trans/base.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,17 +1969,17 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
19691969

19701970
trait IdAndTy {
19711971
fn id(&self) -> ast::node_id;
1972-
fn ty(&self) -> @ast::Ty;
1972+
fn ty<'a>(&'a self) -> &'a ast::Ty;
19731973
}
19741974

19751975
impl IdAndTy for ast::variant_arg {
19761976
fn id(&self) -> ast::node_id { self.id }
1977-
fn ty(&self) -> @ast::Ty { self.ty }
1977+
fn ty<'a>(&'a self) -> &'a ast::Ty { &self.ty }
19781978
}
19791979

19801980
impl IdAndTy for @ast::struct_field {
19811981
fn id(&self) -> ast::node_id { self.node.id }
1982-
fn ty(&self) -> @ast::Ty { self.node.ty }
1982+
fn ty<'a>(&'a self) -> &'a ast::Ty { &self.node.ty }
19831983
}
19841984

19851985
pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
@@ -1994,7 +1994,7 @@ pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
19941994
let fn_args = do args.map |varg| {
19951995
ast::arg {
19961996
is_mutbl: false,
1997-
ty: varg.ty(),
1997+
ty: copy *varg.ty(),
19981998
pat: ast_util::ident_to_pat(
19991999
ccx.tcx.sess.next_node_id(),
20002000
codemap::dummy_sp(),
@@ -2977,8 +2977,12 @@ pub fn trans_crate(sess: session::Session,
29772977
do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| {
29782978
insns_a > insns_b
29792979
}
2980-
for ccx.stats.fn_stats.iter().advance |&(name, ms, insns)| {
2981-
io::println(fmt!("%u insns, %u ms, %s", insns, ms, name));
2980+
for ccx.stats.fn_stats.iter().advance |tuple| {
2981+
match *tuple {
2982+
(ref name, ms, insns) => {
2983+
io::println(fmt!("%u insns, %u ms, %s", insns, ms, *name));
2984+
}
2985+
}
29822986
}
29832987
}
29842988
if ccx.sess.count_llvm_insns() {

src/librustc/middle/typeck/coherence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl CoherenceChecker {
209209
match item.node {
210210
item_impl(_, ref opt_trait, _, _) => {
211211
let opt_trait : ~[trait_ref] = opt_trait.iter()
212-
.transform(|&x| x)
212+
.transform(|x| copy *x)
213213
.collect();
214214
self.check_implementation(item, opt_trait);
215215
}
@@ -270,7 +270,7 @@ impl CoherenceChecker {
270270
// We only want to generate one Impl structure. When we generate one,
271271
// we store it here so that we don't recreate it.
272272
let mut implementation_opt = None;
273-
for associated_traits.iter().advance |&associated_trait| {
273+
for associated_traits.iter().advance |associated_trait| {
274274
let trait_ref =
275275
ty::node_id_to_trait_ref(
276276
self.crate_context.tcx,

src/libstd/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ impl<T> OwnedVector<T> for ~[T] {
12771277
let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]);
12781278
unsafe {
12791279
raw::set_len(self, ln - 1u);
1280-
ptr::read_ptr(valptr)
1280+
Some(ptr::read_ptr(valptr))
12811281
}
12821282
}
12831283
}

src/libsyntax/ext/deriving/generic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,8 @@ impl<'self> MethodDef<'self> {
519519
// create the generics that aren't for Self
520520
let fn_generics = self.generics.to_generics(cx, span, type_ident, generics);
521521

522-
let args = do arg_types.map |&(id, ty)| {
523-
cx.arg(span, id, ty)
522+
let args = do arg_types.map |pair| {
523+
cx.arg(span, pair.first(), pair.second())
524524
};
525525

526526
let ret_type = self.get_ret_ty(cx, span, generics, type_ident);
@@ -896,8 +896,8 @@ pub fn create_subpatterns(cx: @ExtCtxt,
896896
field_paths: ~[ast::Path],
897897
mutbl: ast::mutability)
898898
-> ~[@ast::pat] {
899-
do field_paths.map |&path| {
900-
cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), path, None))
899+
do field_paths.map |path| {
900+
cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), copy *path, None))
901901
}
902902
}
903903

src/libsyntax/ext/pipes/pipec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl gen_send for message {
137137
let arg_names = vec::from_fn(tys.len(), |i| "x_" + i.to_str());
138138

139139
let args_ast: ~[ast::arg] = arg_names.iter().zip(tys.iter())
140-
.transform(|(&n, t)| cx.arg(span, cx.ident_of(n), copy *t)).collect();
140+
.transform(|(n, t)| cx.arg(span, cx.ident_of(*n), copy *t)).collect();
141141

142142
let args_ast = vec::append(
143143
~[cx.arg(span,

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@ impl Parser {
39143914
};
39153915
let full_path = full_path.normalize();
39163916

3917-
let maybe_i = do self.sess.included_mod_stack.iter().position |&p| { p == full_path };
3917+
let maybe_i = do self.sess.included_mod_stack.iter().position |p| { *p == full_path };
39183918
match maybe_i {
39193919
Some(i) => {
39203920
let stack = &self.sess.included_mod_stack;

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ pub fn print_bounded_path(s: @ps, path: &ast::Path,
15261526
print_path_(s, path, false, bounds)
15271527
}
15281528

1529-
pub fn print_pat(s: @ps, pat: @ast::pat) {
1529+
pub fn print_pat(s: @ps, pat: &ast::pat) {
15301530
maybe_print_comment(s, pat.span.lo);
15311531
let ann_node = node_pat(s, pat);
15321532
(s.ann.pre)(ann_node);

0 commit comments

Comments
 (0)