diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-06-09 10:58:34 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-06-09 10:58:34 +0800 |
commit | 374a42466ee4e9d0a25ef65f73b84e3c870d6f79 (patch) | |
tree | 7c9e1575cdbf8b011d56f65f16a8dcc2431bc66f /src/hir_expand | |
parent | 9f8d9fa81be1c11b50bc5ced608a3bd18a53de21 (diff) | |
download | mrust-374a42466ee4e9d0a25ef65f73b84e3c870d6f79.tar.gz |
Fix use of hard tabs
Diffstat (limited to 'src/hir_expand')
-rw-r--r-- | src/hir_expand/erased_types.cpp | 42 | ||||
-rw-r--r-- | src/hir_expand/ufcs_everything.cpp | 6 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/hir_expand/erased_types.cpp b/src/hir_expand/erased_types.cpp index f5fbe27a..caf42a79 100644 --- a/src/hir_expand/erased_types.cpp +++ b/src/hir_expand/erased_types.cpp @@ -14,23 +14,23 @@ const ::HIR::Function& HIR_Expand_ErasedType_GetFunction(const Span& sp, const StaticTraitResolve& resolve, const ::HIR::Path& origin_path, t_cb_generic& monomorph_cb, ::HIR::PathParams& impl_params) { const ::HIR::Function* fcn_ptr = nullptr; - switch(origin_path.m_data.tag()) - { + switch(origin_path.m_data.tag()) + { case ::HIR::Path::Data::TAGDEAD: BUG(Span(), "DEAD in ErasedType - " << origin_path); - case ::HIR::Path::Data::TAG_UfcsUnknown: - BUG(Span(), "UfcsUnknown in ErasedType - " << origin_path); - case ::HIR::Path::Data::TAG_Generic: { - const auto& pe = origin_path.m_data.as_Generic(); - monomorph_cb = monomorphise_type_get_cb(sp, nullptr, nullptr, &pe.m_params); - fcn_ptr = &resolve.m_crate.get_function_by_path(sp, pe.m_path); - } break; - case ::HIR::Path::Data::TAG_UfcsKnown: - // NOTE: This isn't possible yet (will it be? or will it expand to an associated type?) - TODO(sp, "Replace ErasedType - " << origin_path << " with source (UfcsKnown)"); - break; - case ::HIR::Path::Data::TAG_UfcsInherent: { - const auto& pe = origin_path.m_data.as_UfcsInherent(); + case ::HIR::Path::Data::TAG_UfcsUnknown: + BUG(Span(), "UfcsUnknown in ErasedType - " << origin_path); + case ::HIR::Path::Data::TAG_Generic: { + const auto& pe = origin_path.m_data.as_Generic(); + monomorph_cb = monomorphise_type_get_cb(sp, nullptr, nullptr, &pe.m_params); + fcn_ptr = &resolve.m_crate.get_function_by_path(sp, pe.m_path); + } break; + case ::HIR::Path::Data::TAG_UfcsKnown: + // NOTE: This isn't possible yet (will it be? or will it expand to an associated type?) + TODO(sp, "Replace ErasedType - " << origin_path << " with source (UfcsKnown)"); + break; + case ::HIR::Path::Data::TAG_UfcsInherent: { + const auto& pe = origin_path.m_data.as_UfcsInherent(); // 1. Find correct impl block for the path const ::HIR::TypeImpl* impl_ptr = nullptr; resolve.m_crate.find_type_impls(*pe.type, [&](const auto& ty)->const auto& { return ty; }, @@ -54,16 +54,16 @@ const ::HIR::Function& HIR_Expand_ErasedType_GetFunction(const Span& sp, const S return ::HIR::Compare::Equal; }); for(const auto& t : impl_params.m_types) - { + { if( t == ::HIR::TypeRef() ) - { + { TODO(sp, "Handle ErasedType where an impl parameter comes from a bound - " << origin_path); - } - } + } + } monomorph_cb = monomorphise_type_get_cb(sp, &*pe.type, &impl_params, &pe.params); - } break; - } + } break; + } assert(fcn_ptr); return *fcn_ptr; } diff --git a/src/hir_expand/ufcs_everything.cpp b/src/hir_expand/ufcs_everything.cpp index 44921105..adae855c 100644 --- a/src/hir_expand/ufcs_everything.cpp +++ b/src/hir_expand/ufcs_everything.cpp @@ -289,7 +289,7 @@ namespace { ASSERT_BUG(sp, ty_slot == ty_val, "Types must equal for non-operator assignment, " << ty_slot << " != " << ty_val); return ; _(Shr): {langitem = "shr_assign"; opname = "shr_assign"; } if(0) - _(Shl): {langitem = "shl_assign"; opname = "shl_assign"; } + _(Shl): {langitem = "shl_assign"; opname = "shl_assign"; } if( is_op_valid_shift(ty_slot, ty_val) ) { return ; } @@ -385,8 +385,8 @@ namespace { auto ty_r_ref = ::HIR::TypeRef::new_borrow( ::HIR::BorrowType::Shared, ty_r.clone() ); ::std::vector< ::HIR::ExprNodeP> args; - auto sp_left = node.m_left ->span(); - auto sp_right = node.m_right->span(); + auto sp_left = node.m_left ->span(); + auto sp_right = node.m_right->span(); args.push_back(NEWNODE(ty_l_ref.clone(), Borrow, sp_left , ::HIR::BorrowType::Shared, mv$(node.m_left ) )); args.push_back(NEWNODE(ty_r_ref.clone(), Borrow, sp_right, ::HIR::BorrowType::Shared, mv$(node.m_right) )); |