Skip to content

Commit 3abf724

Browse files
committed
stacked-contexts: Add peek() method
gcc/rust/ChangeLog: * util/rust-stacked-contexts.h: Add new method to see what context we are currently in.
1 parent afbd873 commit 3abf724

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gcc/rust/util/rust-stacked-contexts.h

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ template <typename T> class StackedContexts
7171
return last;
7272
}
7373

74+
const T &peek ()
75+
{
76+
rust_assert (!stack.empty ());
77+
78+
return stack.back ();
79+
}
80+
7481
/**
7582
* Are we currently inside of a special context?
7683
*/

0 commit comments

Comments
 (0)