Correct merge errors

This commit is contained in:
Niko Matsakis 2013-07-08 11:05:52 -04:00
parent b5fc4ae918
commit 0c6d02f391
8 changed files with 24 additions and 20 deletions

View file

@ -1842,7 +1842,7 @@ pub fn store_arg(mut bcx: block,
fn mk_binding_alloca(mut bcx: block, fn mk_binding_alloca(mut bcx: block,
p_id: ast::node_id, p_id: ast::node_id,
path: @ast::Path, path: &ast::Path,
binding_mode: IrrefutablePatternBindingMode, binding_mode: IrrefutablePatternBindingMode,
populate: &fn(block, ty::t, ValueRef) -> block) -> block { populate: &fn(block, ty::t, ValueRef) -> block) -> block {
let var_ty = node_id_type(bcx, p_id); let var_ty = node_id_type(bcx, p_id);
@ -1899,7 +1899,7 @@ fn bind_irrefutable_pat(bcx: block,
let tcx = bcx.tcx(); let tcx = bcx.tcx();
let ccx = bcx.ccx(); let ccx = bcx.ccx();
match pat.node { match pat.node {
ast::pat_ident(pat_binding_mode, path, inner) => { ast::pat_ident(pat_binding_mode, ref path, inner) => {
if pat_is_binding(tcx.def_map, pat) { if pat_is_binding(tcx.def_map, pat) {
// Allocate the stack slot where the value of this // Allocate the stack slot where the value of this
// binding will live and place it into the appropriate // binding will live and place it into the appropriate
@ -2017,9 +2017,9 @@ fn bind_irrefutable_pat(bcx: block,
return bcx; return bcx;
} }
fn simple_identifier(pat: @ast::pat) -> Option<@ast::Path> { fn simple_identifier<'a>(pat: &'a ast::pat) -> Option<&'a ast::Path> {
match pat.node { match pat.node {
ast::pat_ident(ast::bind_infer, path, None) => { ast::pat_ident(ast::bind_infer, ref path, None) => {
Some(path) Some(path)
} }
_ => { _ => {

View file

@ -1969,17 +1969,17 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
trait IdAndTy { trait IdAndTy {
fn id(&self) -> ast::node_id; fn id(&self) -> ast::node_id;
fn ty(&self) -> @ast::Ty; fn ty<'a>(&'a self) -> &'a ast::Ty;
} }
impl IdAndTy for ast::variant_arg { impl IdAndTy for ast::variant_arg {
fn id(&self) -> ast::node_id { self.id } fn id(&self) -> ast::node_id { self.id }
fn ty(&self) -> @ast::Ty { self.ty } fn ty<'a>(&'a self) -> &'a ast::Ty { &self.ty }
} }
impl IdAndTy for @ast::struct_field { impl IdAndTy for @ast::struct_field {
fn id(&self) -> ast::node_id { self.node.id } fn id(&self) -> ast::node_id { self.node.id }
fn ty(&self) -> @ast::Ty { self.node.ty } fn ty<'a>(&'a self) -> &'a ast::Ty { &self.node.ty }
} }
pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>( 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>(
let fn_args = do args.map |varg| { let fn_args = do args.map |varg| {
ast::arg { ast::arg {
is_mutbl: false, is_mutbl: false,
ty: varg.ty(), ty: copy *varg.ty(),
pat: ast_util::ident_to_pat( pat: ast_util::ident_to_pat(
ccx.tcx.sess.next_node_id(), ccx.tcx.sess.next_node_id(),
codemap::dummy_sp(), codemap::dummy_sp(),
@ -2977,8 +2977,12 @@ pub fn trans_crate(sess: session::Session,
do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| { do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| {
insns_a > insns_b insns_a > insns_b
} }
for ccx.stats.fn_stats.iter().advance |&(name, ms, insns)| { for ccx.stats.fn_stats.iter().advance |tuple| {
io::println(fmt!("%u insns, %u ms, %s", insns, ms, name)); match *tuple {
(ref name, ms, insns) => {
io::println(fmt!("%u insns, %u ms, %s", insns, ms, *name));
}
}
} }
} }
if ccx.sess.count_llvm_insns() { if ccx.sess.count_llvm_insns() {

View file

@ -209,7 +209,7 @@ impl CoherenceChecker {
match item.node { match item.node {
item_impl(_, ref opt_trait, _, _) => { item_impl(_, ref opt_trait, _, _) => {
let opt_trait : ~[trait_ref] = opt_trait.iter() let opt_trait : ~[trait_ref] = opt_trait.iter()
.transform(|&x| x) .transform(|x| copy *x)
.collect(); .collect();
self.check_implementation(item, opt_trait); self.check_implementation(item, opt_trait);
} }
@ -270,7 +270,7 @@ impl CoherenceChecker {
// We only want to generate one Impl structure. When we generate one, // We only want to generate one Impl structure. When we generate one,
// we store it here so that we don't recreate it. // we store it here so that we don't recreate it.
let mut implementation_opt = None; let mut implementation_opt = None;
for associated_traits.iter().advance |&associated_trait| { for associated_traits.iter().advance |associated_trait| {
let trait_ref = let trait_ref =
ty::node_id_to_trait_ref( ty::node_id_to_trait_ref(
self.crate_context.tcx, self.crate_context.tcx,

View file

@ -1277,7 +1277,7 @@ impl<T> OwnedVector<T> for ~[T] {
let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]); let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]);
unsafe { unsafe {
raw::set_len(self, ln - 1u); raw::set_len(self, ln - 1u);
ptr::read_ptr(valptr) Some(ptr::read_ptr(valptr))
} }
} }
} }

View file

@ -519,8 +519,8 @@ impl<'self> MethodDef<'self> {
// create the generics that aren't for Self // create the generics that aren't for Self
let fn_generics = self.generics.to_generics(cx, span, type_ident, generics); let fn_generics = self.generics.to_generics(cx, span, type_ident, generics);
let args = do arg_types.map |&(id, ty)| { let args = do arg_types.map |pair| {
cx.arg(span, id, ty) cx.arg(span, pair.first(), pair.second())
}; };
let ret_type = self.get_ret_ty(cx, span, generics, type_ident); let ret_type = self.get_ret_ty(cx, span, generics, type_ident);
@ -896,8 +896,8 @@ pub fn create_subpatterns(cx: @ExtCtxt,
field_paths: ~[ast::Path], field_paths: ~[ast::Path],
mutbl: ast::mutability) mutbl: ast::mutability)
-> ~[@ast::pat] { -> ~[@ast::pat] {
do field_paths.map |&path| { do field_paths.map |path| {
cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), path, None)) cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), copy *path, None))
} }
} }

View file

@ -137,7 +137,7 @@ impl gen_send for message {
let arg_names = vec::from_fn(tys.len(), |i| "x_" + i.to_str()); let arg_names = vec::from_fn(tys.len(), |i| "x_" + i.to_str());
let args_ast: ~[ast::arg] = arg_names.iter().zip(tys.iter()) let args_ast: ~[ast::arg] = arg_names.iter().zip(tys.iter())
.transform(|(&n, t)| cx.arg(span, cx.ident_of(n), copy *t)).collect(); .transform(|(n, t)| cx.arg(span, cx.ident_of(*n), copy *t)).collect();
let args_ast = vec::append( let args_ast = vec::append(
~[cx.arg(span, ~[cx.arg(span,

View file

@ -3914,7 +3914,7 @@ impl Parser {
}; };
let full_path = full_path.normalize(); let full_path = full_path.normalize();
let maybe_i = do self.sess.included_mod_stack.iter().position |&p| { p == full_path }; let maybe_i = do self.sess.included_mod_stack.iter().position |p| { *p == full_path };
match maybe_i { match maybe_i {
Some(i) => { Some(i) => {
let stack = &self.sess.included_mod_stack; let stack = &self.sess.included_mod_stack;

View file

@ -1526,7 +1526,7 @@ pub fn print_bounded_path(s: @ps, path: &ast::Path,
print_path_(s, path, false, bounds) print_path_(s, path, false, bounds)
} }
pub fn print_pat(s: @ps, pat: @ast::pat) { pub fn print_pat(s: @ps, pat: &ast::pat) {
maybe_print_comment(s, pat.span.lo); maybe_print_comment(s, pat.span.lo);
let ann_node = node_pat(s, pat); let ann_node = node_pat(s, pat);
(s.ann.pre)(ann_node); (s.ann.pre)(ann_node);