about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-06-06 18:38:34 -0600
committerMark Rousskov <mark.simulacrum@gmail.com>2019-06-09 14:09:36 -0600
commit6b9740bf0217ce88d0c2370e955a3c6372d39041 (patch)
tree9d8470be039716476af564f6cdd6e916cb98cf19
parentb1c357e0c366f5fb865151a9dd144413b4bf6911 (diff)
downloadrust-6b9740bf0217ce88d0c2370e955a3c6372d39041.tar.gz
rust-6b9740bf0217ce88d0c2370e955a3c6372d39041.zip
Add comment about raw strings to self.style
-rw-r--r--src/libfmt_macros/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs
index 66355801b6c..520cc870859 100644
--- a/src/libfmt_macros/lib.rs
+++ b/src/libfmt_macros/lib.rs
@@ -301,6 +301,8 @@ impl<'a> Parser<'a> {
 
     fn to_span_index(&self, pos: usize) -> InnerOffset {
         let mut pos = pos;
+        // This handles the raw string case, the raw argument is the number of #
+        // in r###"..."### (we need to add one because of the `r`).
         let raw = self.style.map(|raw| raw + 1).unwrap_or(0);
         for skip in &self.skips {
             if pos > *skip {