Correct merge errors
This commit is contained in:
parent
b5fc4ae918
commit
0c6d02f391
@ -1842,7 +1842,7 @@ pub fn store_arg(mut bcx: block,
|
||||
|
||||
fn mk_binding_alloca(mut bcx: block,
|
||||
p_id: ast::node_id,
|
||||
path: @ast::Path,
|
||||
path: &ast::Path,
|
||||
binding_mode: IrrefutablePatternBindingMode,
|
||||
populate: &fn(block, ty::t, ValueRef) -> block) -> block {
|
||||
let var_ty = node_id_type(bcx, p_id);
|
||||
@ -1899,7 +1899,7 @@ fn bind_irrefutable_pat(bcx: block,
|
||||
let tcx = bcx.tcx();
|
||||
let ccx = bcx.ccx();
|
||||
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) {
|
||||
// Allocate the stack slot where the value of this
|
||||
// binding will live and place it into the appropriate
|
||||
@ -2017,9 +2017,9 @@ fn bind_irrefutable_pat(bcx: block,
|
||||
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 {
|
||||
ast::pat_ident(ast::bind_infer, path, None) => {
|
||||
ast::pat_ident(ast::bind_infer, ref path, None) => {
|
||||
Some(path)
|
||||
}
|
||||
_ => {
|
||||
|
@ -1969,17 +1969,17 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
|
||||
|
||||
trait IdAndTy {
|
||||
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 {
|
||||
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 {
|
||||
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>(
|
||||
@ -1994,7 +1994,7 @@ pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
|
||||
let fn_args = do args.map |varg| {
|
||||
ast::arg {
|
||||
is_mutbl: false,
|
||||
ty: varg.ty(),
|
||||
ty: copy *varg.ty(),
|
||||
pat: ast_util::ident_to_pat(
|
||||
ccx.tcx.sess.next_node_id(),
|
||||
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)| {
|
||||
insns_a > insns_b
|
||||
}
|
||||
for ccx.stats.fn_stats.iter().advance |&(name, ms, insns)| {
|
||||
io::println(fmt!("%u insns, %u ms, %s", insns, ms, name));
|
||||
for ccx.stats.fn_stats.iter().advance |tuple| {
|
||||
match *tuple {
|
||||
(ref name, ms, insns) => {
|
||||
io::println(fmt!("%u insns, %u ms, %s", insns, ms, *name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ccx.sess.count_llvm_insns() {
|
||||
|
@ -209,7 +209,7 @@ impl CoherenceChecker {
|
||||
match item.node {
|
||||
item_impl(_, ref opt_trait, _, _) => {
|
||||
let opt_trait : ~[trait_ref] = opt_trait.iter()
|
||||
.transform(|&x| x)
|
||||
.transform(|x| copy *x)
|
||||
.collect();
|
||||
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 store it here so that we don't recreate it.
|
||||
let mut implementation_opt = None;
|
||||
for associated_traits.iter().advance |&associated_trait| {
|
||||
for associated_traits.iter().advance |associated_trait| {
|
||||
let trait_ref =
|
||||
ty::node_id_to_trait_ref(
|
||||
self.crate_context.tcx,
|
||||
|
@ -1277,7 +1277,7 @@ impl<T> OwnedVector<T> for ~[T] {
|
||||
let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]);
|
||||
unsafe {
|
||||
raw::set_len(self, ln - 1u);
|
||||
ptr::read_ptr(valptr)
|
||||
Some(ptr::read_ptr(valptr))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -519,8 +519,8 @@ impl<'self> MethodDef<'self> {
|
||||
// create the generics that aren't for Self
|
||||
let fn_generics = self.generics.to_generics(cx, span, type_ident, generics);
|
||||
|
||||
let args = do arg_types.map |&(id, ty)| {
|
||||
cx.arg(span, id, ty)
|
||||
let args = do arg_types.map |pair| {
|
||||
cx.arg(span, pair.first(), pair.second())
|
||||
};
|
||||
|
||||
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],
|
||||
mutbl: ast::mutability)
|
||||
-> ~[@ast::pat] {
|
||||
do field_paths.map |&path| {
|
||||
cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), path, None))
|
||||
do field_paths.map |path| {
|
||||
cx.pat(span, ast::pat_ident(ast::bind_by_ref(mutbl), copy *path, None))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ impl gen_send for message {
|
||||
let arg_names = vec::from_fn(tys.len(), |i| "x_" + i.to_str());
|
||||
|
||||
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(
|
||||
~[cx.arg(span,
|
||||
|
@ -3914,7 +3914,7 @@ impl Parser {
|
||||
};
|
||||
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 {
|
||||
Some(i) => {
|
||||
let stack = &self.sess.included_mod_stack;
|
||||
|
@ -1526,7 +1526,7 @@ pub fn print_bounded_path(s: @ps, path: &ast::Path,
|
||||
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);
|
||||
let ann_node = node_pat(s, pat);
|
||||
(s.ann.pre)(ann_node);
|
||||
|
Loading…
x
Reference in New Issue
Block a user