Reindent some match exprs to agree with rust-mode.el
This commit is contained in:
@@ -25,20 +25,20 @@ fn transform_self_type_for_method(fcx: @fn_ctxt,
|
|||||||
method_info: MethodInfo)
|
method_info: MethodInfo)
|
||||||
-> ty::t {
|
-> ty::t {
|
||||||
match method_info.self_type {
|
match method_info.self_type {
|
||||||
sty_by_ref | sty_value => {
|
sty_by_ref | sty_value => {
|
||||||
impl_ty
|
impl_ty
|
||||||
}
|
}
|
||||||
sty_region(r, mutability) => {
|
sty_region(r, mutability) => {
|
||||||
// XXX: dummy_sp is unfortunate here.
|
// XXX: dummy_sp is unfortunate here.
|
||||||
let region = ast_region_to_region(fcx, fcx, dummy_sp(), r);
|
let region = ast_region_to_region(fcx, fcx, dummy_sp(), r);
|
||||||
mk_rptr(fcx.ccx.tcx, region, { ty: impl_ty, mutbl: mutability })
|
mk_rptr(fcx.ccx.tcx, region, { ty: impl_ty, mutbl: mutability })
|
||||||
}
|
}
|
||||||
sty_box(mutability) => {
|
sty_box(mutability) => {
|
||||||
mk_box(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
|
mk_box(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
|
||||||
}
|
}
|
||||||
sty_uniq(mutability) => {
|
sty_uniq(mutability) => {
|
||||||
mk_uniq(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
|
mk_uniq(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,21 +96,21 @@ class lookup {
|
|||||||
match get_base_type_def_id(self.fcx.infcx,
|
match get_base_type_def_id(self.fcx.infcx,
|
||||||
self.self_expr.span,
|
self.self_expr.span,
|
||||||
self.self_ty) {
|
self.self_ty) {
|
||||||
none => {
|
none => {
|
||||||
optional_inherent_methods = none;
|
optional_inherent_methods = none;
|
||||||
}
|
}
|
||||||
some(base_type_def_id) => {
|
some(base_type_def_id) => {
|
||||||
debug!{"(checking method) found base type"};
|
debug!{"(checking method) found base type"};
|
||||||
optional_inherent_methods =
|
optional_inherent_methods =
|
||||||
self.fcx.ccx.coherence_info.inherent_methods.find
|
self.fcx.ccx.coherence_info.inherent_methods.find
|
||||||
(base_type_def_id);
|
(base_type_def_id);
|
||||||
|
|
||||||
if optional_inherent_methods.is_none() {
|
if optional_inherent_methods.is_none() {
|
||||||
debug!{"(checking method) ... no inherent methods found"};
|
debug!{"(checking method) ... no inherent methods found"};
|
||||||
} else {
|
} else {
|
||||||
debug!{"(checking method) ... inherent methods found"};
|
debug!{"(checking method) ... inherent methods found"};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@@ -462,52 +462,52 @@ class lookup {
|
|||||||
|
|
||||||
// Add inherent methods.
|
// Add inherent methods.
|
||||||
match optional_inherent_methods {
|
match optional_inherent_methods {
|
||||||
none => {
|
none => {
|
||||||
// Continue.
|
// Continue.
|
||||||
}
|
}
|
||||||
some(inherent_methods) => {
|
some(inherent_methods) => {
|
||||||
debug!{"(adding inherent and extension candidates) adding \
|
debug!{"(adding inherent and extension candidates) adding \
|
||||||
inherent candidates"};
|
inherent candidates"};
|
||||||
for inherent_methods.each |implementation| {
|
for inherent_methods.each |implementation| {
|
||||||
debug!{"(adding inherent and extension candidates) \
|
debug!{"(adding inherent and extension candidates) \
|
||||||
adding candidates from impl: %s",
|
adding candidates from impl: %s",
|
||||||
node_id_to_str(self.tcx().items,
|
node_id_to_str(self.tcx().items,
|
||||||
implementation.did.node)};
|
implementation.did.node)};
|
||||||
self.add_candidates_from_impl(implementation,
|
self.add_candidates_from_impl(implementation,
|
||||||
use_assignability);
|
use_assignability);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add trait methods.
|
// Add trait methods.
|
||||||
match self.fcx.ccx.trait_map.find(self.expr.id) {
|
match self.fcx.ccx.trait_map.find(self.expr.id) {
|
||||||
none => {
|
none => {
|
||||||
// Should only happen for placement new right now.
|
// Should only happen for placement new right now.
|
||||||
}
|
}
|
||||||
some(trait_ids) => {
|
some(trait_ids) => {
|
||||||
for (*trait_ids).each |trait_id| {
|
for (*trait_ids).each |trait_id| {
|
||||||
debug!{"(adding inherent and extension candidates) \
|
debug!{"(adding inherent and extension candidates) \
|
||||||
trying trait: %s",
|
trying trait: %s",
|
||||||
self.def_id_to_str(trait_id)};
|
self.def_id_to_str(trait_id)};
|
||||||
|
|
||||||
let coherence_info = self.fcx.ccx.coherence_info;
|
let coherence_info = self.fcx.ccx.coherence_info;
|
||||||
match coherence_info.extension_methods.find(trait_id) {
|
match coherence_info.extension_methods.find(trait_id) {
|
||||||
none => {
|
none => {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
some(extension_methods) => {
|
some(extension_methods) => {
|
||||||
for extension_methods.each |implementation| {
|
for extension_methods.each |implementation| {
|
||||||
debug!{"(adding inherent and extension \
|
debug!{"(adding inherent and extension \
|
||||||
candidates) adding impl %s",
|
candidates) adding impl %s",
|
||||||
self.def_id_to_str
|
self.def_id_to_str
|
||||||
(implementation.did)};
|
(implementation.did)};
|
||||||
self.add_candidates_from_impl
|
self.add_candidates_from_impl
|
||||||
(implementation, use_assignability);
|
(implementation, use_assignability);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ class lookup {
|
|||||||
// required receiver type (cand.rcvr_ty). If this method is not
|
// required receiver type (cand.rcvr_ty). If this method is not
|
||||||
// from an impl, this'll basically be a no-nop.
|
// from an impl, this'll basically be a no-nop.
|
||||||
match self.fcx.mk_assignty(self.self_expr, self.borrow_lb,
|
match self.fcx.mk_assignty(self.self_expr, self.borrow_lb,
|
||||||
cand.self_ty, cand.rcvr_ty) {
|
cand.self_ty, cand.rcvr_ty) {
|
||||||
result::ok(_) => (),
|
result::ok(_) => (),
|
||||||
result::err(_) => {
|
result::err(_) => {
|
||||||
self.tcx().sess.span_bug(
|
self.tcx().sess.span_bug(
|
||||||
|
|||||||
Reference in New Issue
Block a user