提交 191fdda4 编写于 作者: E Erick Tryzelaar

rustc: minor cleanup

上级 2fc6b099
......@@ -70,7 +70,12 @@ pub fn trans_impl(ccx: @CrateContext, path: path, name: ast::ident,
}
}
trans_method(ccx, path, *method, param_substs_opt, self_ty, llfn,
trans_method(ccx,
path,
*method,
param_substs_opt,
self_ty,
llfn,
ast_util::local_def(id));
}
}
......@@ -106,11 +111,10 @@ pub fn trans_method(ccx: @CrateContext,
_ => {
// determine the (monomorphized) type that `self` maps to for
// this method
let self_ty;
match base_self_ty {
None => self_ty = ty::node_id_to_type(ccx.tcx, method.self_id),
Some(provided_self_ty) => self_ty = provided_self_ty
}
let self_ty = match base_self_ty {
None => ty::node_id_to_type(ccx.tcx, method.self_id),
Some(provided_self_ty) => provided_self_ty,
};
let self_ty = match param_substs {
None => self_ty,
Some(@param_substs {tys: ref tys, _}) => {
......
......@@ -331,8 +331,7 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
node_type_needs(cx, use_tydesc, val.id);
}
expr_call(f, _, _) => {
for vec::each(ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx,
f.id))) |a| {
for ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx, f.id))).each |a| {
type_needs(cx, use_repr, a.ty);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册