public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Remove unused default_ty_param from TypeResolveGenericParam::visit
@ 2021-06-29 22:11 Mark Wielaard
  2021-06-29 22:11 ` [PATCH 2/2] Remove unused have_more_segments from TypeCheckExpr::resolve_root_path Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2021-06-29 22:11 UTC (permalink / raw)
  To: gcc-rust; +Cc: Mark Wielaard

The default_ty_param was set, but not used. We do need to call TypeCheckType::Resolve
on the default param, but don't need the result.
---
 gcc/rust/typecheck/rust-hir-type-check-type.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.h b/gcc/rust/typecheck/rust-hir-type-check-type.h
index b4baccf4299..6081ec549ce 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.h
@@ -255,11 +255,9 @@ public:
 
   void visit (HIR::TypeParam &param) override
   {
-    TyTy::BaseType *default_ty_param = nullptr;
     if (param.has_type ())
-      {
-	default_ty_param = TypeCheckType::Resolve (param.get_type ().get ());
-      }
+      TypeCheckType::Resolve (param.get_type ().get ());
+
     resolved = new TyTy::ParamType (param.get_type_representation (),
 				    param.get_mappings ().get_hirid (), param);
   }
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Remove unused have_more_segments from TypeCheckExpr::resolve_root_path
  2021-06-29 22:11 [PATCH 1/2] Remove unused default_ty_param from TypeResolveGenericParam::visit Mark Wielaard
@ 2021-06-29 22:11 ` Mark Wielaard
  2021-06-30  6:54   ` Marc
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2021-06-29 22:11 UTC (permalink / raw)
  To: gcc-rust; +Cc: Mark Wielaard

It isn't necessary to know whether there are more segments while
iteration through the expression segements.
---
 gcc/rust/typecheck/rust-hir-type-check-expr.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h
index e06b10d358a..327a9a06df7 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@ -1121,7 +1121,6 @@ private:
     for (size_t i = 0; i < expr.get_num_segments (); i++)
       {
 	HIR::PathExprSegment &seg = expr.get_segments ().at (i);
-	bool have_more_segments = i < expr.get_num_segments ();
 	bool is_root = *offset == 0;
 	NodeId ast_node_id = seg.get_mappings ().get_nodeid ();
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Remove unused have_more_segments from TypeCheckExpr::resolve_root_path
  2021-06-29 22:11 ` [PATCH 2/2] Remove unused have_more_segments from TypeCheckExpr::resolve_root_path Mark Wielaard
@ 2021-06-30  6:54   ` Marc
  0 siblings, 0 replies; 3+ messages in thread
From: Marc @ 2021-06-30  6:54 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: gcc-rust

Mark Wielaard <mark@klomp.org> writes:

> It isn't necessary to know whether there are more segments while
> iteration through the expression segements.

Both patches in GH: https://github.com/Rust-GCC/gccrs/pull/537/commits

Fixed a small typo in the commit message while creating the PR :)

Marc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-30  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 22:11 [PATCH 1/2] Remove unused default_ty_param from TypeResolveGenericParam::visit Mark Wielaard
2021-06-29 22:11 ` [PATCH 2/2] Remove unused have_more_segments from TypeCheckExpr::resolve_root_path Mark Wielaard
2021-06-30  6:54   ` Marc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).