privacy: visibility: Assert on module stack instead

Co-authored-by: philberty <philip.herron@embecosm.com>
This commit is contained in:
Arthur Cohen 2022-04-22 13:18:30 +02:00
parent 3e3c0660cb
commit c3a81139f7
1 changed files with 1 additions and 2 deletions

View File

@ -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 ();
}