public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] privacy: visibility: Assert on module stack instead
@ 2022-06-08 12:35 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c3a81139f72a05e85fa7cfa42089b49b82949592

commit c3a81139f72a05e85fa7cfa42089b49b82949592
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Fri Apr 22 13:18:30 2022 +0200

    privacy: visibility: Assert on module stack instead
    
    Co-authored-by: philberty <philip.herron@embecosm.com>

Diff:
---
 gcc/rust/privacy/rust-visibility-resolver.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/rust/privacy/rust-visibility-resolver.cc b/gcc/rust/privacy/rust-visibility-resolver.cc
index e22f180deb4..0b7a52910cd 100644
--- a/gcc/rust/privacy/rust-visibility-resolver.cc
+++ b/gcc/rust/privacy/rust-visibility-resolver.cc
@@ -69,8 +69,7 @@ VisibilityResolver::peek_module ()
 {
   // We're always inserting a top module - the crate
   // But we have to check otherwise `.back()` is UB
-  if (module_stack.empty ())
-    gcc_unreachable ();
+  rust_assert (!module_stack.empty ());
 
   return module_stack.back ();
 }


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

only message in thread, other threads:[~2022-06-08 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:35 [gcc/devel/rust/master] privacy: visibility: Assert on module stack instead 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).