diff options
Diffstat (limited to 'gcc/rust/util/rust-stacked-contexts.h')
-rw-r--r-- | gcc/rust/util/rust-stacked-contexts.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-stacked-contexts.h b/gcc/rust/util/rust-stacked-contexts.h index 39a0c08..fe0bc8a 100644 --- a/gcc/rust/util/rust-stacked-contexts.h +++ b/gcc/rust/util/rust-stacked-contexts.h @@ -71,6 +71,13 @@ public: return last; } + const T &peek () + { + rust_assert (!stack.empty ()); + + return stack.back (); + } + /** * Are we currently inside of a special context? */ |