summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_lexer/src/cursor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_lexer/src/cursor.rs')
-rw-r--r--compiler/rustc_lexer/src/cursor.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_lexer/src/cursor.rs b/compiler/rustc_lexer/src/cursor.rs
index eceef5980..aba7f9548 100644
--- a/compiler/rustc_lexer/src/cursor.rs
+++ b/compiler/rustc_lexer/src/cursor.rs
@@ -24,6 +24,10 @@ impl<'a> Cursor<'a> {
}
}
+ pub fn as_str(&self) -> &'a str {
+ self.chars.as_str()
+ }
+
/// Returns the last eaten symbol (or `'\0'` in release builds).
/// (For debug assertions only.)
pub(crate) fn prev(&self) -> char {