Skip to content

Commit c3a8113

Browse files
privacy: visibility: Assert on module stack instead
Co-authored-by: philberty <philip.herron@embecosm.com>
1 parent 3e3c066 commit c3a8113

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gcc/rust/privacy/rust-visibility-resolver.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ VisibilityResolver::peek_module ()
6969
{
7070
// We're always inserting a top module - the crate
7171
// But we have to check otherwise `.back()` is UB
72-
if (module_stack.empty ())
73-
gcc_unreachable ();
72+
rust_assert (!module_stack.empty ());
7473

7574
return module_stack.back ();
7675
}

0 commit comments

Comments
 (0)