public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Cleanup and Assertion
@ 2023-03-08  9:56 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-03-08  9:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:136c765c748ab283eb95868b05da1269694e60be

commit 136c765c748ab283eb95868b05da1269694e60be
Author: Parthib <parthibdutta02@gmail.com>
Date:   Mon Mar 6 07:34:43 2023 +0530

    Cleanup and Assertion
    
    gcc/rust/ChangLog:
    
            * rust-object-export.cc: Modified
            * hir/rust-ast-lower-type.cc (rust_fatal_error): Removed
                    (rust_assert): Added
    
    Signed-off-by: Parthib <parthibdutta02@gmail.com>

Diff:
---
 gcc/rust/hir/rust-ast-lower-type.cc | 22 ++++++----------------
 gcc/rust/rust-object-export.cc      |  3 +--
 2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/gcc/rust/hir/rust-ast-lower-type.cc b/gcc/rust/hir/rust-ast-lower-type.cc
index 9ea22b01f32..d767de6f699 100644
--- a/gcc/rust/hir/rust-ast-lower-type.cc
+++ b/gcc/rust/hir/rust-ast-lower-type.cc
@@ -108,11 +108,8 @@ ASTLowerTypePath::visit (AST::TypePath &path)
     {
       translated_segment = nullptr;
       seg->accept_vis (*this);
-      if (translated_segment == nullptr)
-	{
-	  rust_fatal_error (seg->get_locus (),
-			    "failed to translate AST TypePathSegment");
-	}
+      rust_assert (translated_segment != nullptr);
+
       translated_segments.push_back (
 	std::unique_ptr<HIR::TypePathSegment> (translated_segment));
     }
@@ -158,12 +155,8 @@ ASTLowerQualifiedPathInType::visit (AST::QualifiedPathInType &path)
 
   translated_segment = nullptr;
   path.get_associated_segment ()->accept_vis (*this);
-  if (translated_segment == nullptr)
-    {
-      rust_fatal_error (path.get_associated_segment ()->get_locus (),
-			"failed to translate AST TypePathSegment");
-      return;
-    }
+  rust_assert (translated_segment != nullptr);
+
   std::unique_ptr<HIR::TypePathSegment> associated_segment (translated_segment);
 
   std::vector<std::unique_ptr<HIR::TypePathSegment>> translated_segments;
@@ -171,11 +164,8 @@ ASTLowerQualifiedPathInType::visit (AST::QualifiedPathInType &path)
     {
       translated_segment = nullptr;
       seg->accept_vis (*this);
-      if (translated_segment == nullptr)
-	{
-	  rust_fatal_error (seg->get_locus (),
-			    "failed to translte AST TypePathSegment");
-	}
+      rust_assert (translated_segment != nullptr);
+
       translated_segments.push_back (
 	std::unique_ptr<HIR::TypePathSegment> (translated_segment));
     }
diff --git a/gcc/rust/rust-object-export.cc b/gcc/rust/rust-object-export.cc
index 1143c767784..c2e56febfef 100644
--- a/gcc/rust/rust-object-export.cc
+++ b/gcc/rust/rust-object-export.cc
@@ -1,5 +1,4 @@
-/* rust-backend.c -- Rust frontend interface to gcc backend.
-   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2023 Free Software Foundation, Inc.
 
    This file is part of GCC.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-08  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  9:56 [gcc/devel/rust/master] Cleanup and Assertion Thomas Schwinge

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).