Skip to content

Commit

Permalink
typecheck-path: Fix typo (reciever -> receiver)
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* typecheck/rust-hir-path-probe.cc: Fix typos.
	* typecheck/rust-hir-path-probe.h: Likewise.
	* typecheck/rust-hir-type-check-path.cc: Likewise.
  • Loading branch information
CohenArthur committed Dec 24, 2024
1 parent d28cae5 commit af5fdee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gcc/rust/typecheck/rust-hir-path-probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ PathProbeType::Probe (const TyTy::BaseType *receiver,
if (!probe_bounds)
return probe.candidates;

if (!probe.is_reciever_generic ())
if (!probe.is_receiver_generic ())
{
std::vector<std::pair<TraitReference *, HIR::ImplBlock *>> probed_bounds
= TypeBoundsProbe::Probe (receiver);
Expand Down Expand Up @@ -433,7 +433,7 @@ PathProbeType::union_bounds (
}

bool
PathProbeType::is_reciever_generic () const
PathProbeType::is_receiver_generic () const
{
const TyTy::BaseType *root = receiver->get_root ();
bool receiver_is_type_param = root->get_kind () == TyTy::TypeKind::PARAM;
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/typecheck/rust-hir-path-probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class PathProbeType : public TypeCheckBase, public HIR::HIRImplVisitor
const std::vector<std::pair<const TraitReference *, HIR::ImplBlock *>> b)
const;

bool is_reciever_generic () const;
bool is_receiver_generic () const;

const TyTy::BaseType *receiver;
const HIR::PathIdentSegment &search;
Expand Down
10 changes: 5 additions & 5 deletions gcc/rust/typecheck/rust-hir-type-check-path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id,
{
NodeId resolved_node_id = root_resolved_node_id;
TyTy::BaseType *prev_segment = tyseg;
bool reciever_is_generic = prev_segment->get_kind () == TyTy::TypeKind::PARAM;
bool reciever_is_dyn = prev_segment->get_kind () == TyTy::TypeKind::DYNAMIC;
bool receiver_is_generic = prev_segment->get_kind () == TyTy::TypeKind::PARAM;
bool receiver_is_dyn = prev_segment->get_kind () == TyTy::TypeKind::DYNAMIC;

for (size_t i = offset; i < segments.size (); i++)
{
HIR::PathExprSegment &seg = segments.at (i);
bool probe_impls = !reciever_is_generic;
bool probe_impls = !receiver_is_generic;

// probe the path is done in two parts one where we search impls if no
// candidate is found then we search extensions from traits
Expand Down Expand Up @@ -435,7 +435,7 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id,
}
}

if (associated_impl_block != nullptr && !reciever_is_dyn)
if (associated_impl_block != nullptr && !receiver_is_dyn)
{
// associated types
HirId impl_block_id
Expand Down Expand Up @@ -492,7 +492,7 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id,
if (tyseg->get_kind () == TyTy::TypeKind::ERROR)
return;
}
else if (tyseg->needs_generic_substitutions () && !reciever_is_generic)
else if (tyseg->needs_generic_substitutions () && !receiver_is_generic)
{
location_t locus = seg.get_locus ();
tyseg = SubstMapper::InferSubst (tyseg, locus);
Expand Down

0 comments on commit af5fdee

Please sign in to comment.