about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-11-16 20:11:05 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-11-17 01:11:28 +0300
commit11580ced403211c8c422a952a2c5dabedf6812d6 (patch)
tree8d8bac55b4a4a793af8c1a94036537bb39acb31f /src/librustc_parse/parser
parenta699f17483baeff87dc027331bce9a552a6b0624 (diff)
Address review comments
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/expr.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs
index be1dc4f19a7..a56a7bf1802 100644
--- a/src/librustc_parse/parser/expr.rs
+++ b/src/librustc_parse/parser/expr.rs
@@ -1073,6 +1073,9 @@ impl<'a> Parser<'a> {
         self.maybe_recover_from_bad_qpath(expr, true)
     }
 
+    /// Returns a string literal if the next token is a string literal.
+    /// In case of error returns `Some(lit)` if the next token is a literal with a wrong kind,
+    /// and returns `None` if the next token is not literal at all.
     pub fn parse_str_lit(&mut self) -> Result<ast::StrLit, Option<Lit>> {
         match self.parse_opt_lit() {
             Some(lit) => match lit.kind {