diff --git a/src/doc/reference.md b/src/doc/reference.md index 781b40be768..87130c08991 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -302,7 +302,7 @@ nonzero_dec: '1' | '2' | '3' | '4' A _character literal_ is a single Unicode character enclosed within two `U+0027` (single-quote) characters, with the exception of `U+0027` itself, -which must be _escaped_ by a preceding U+005C character (`\`). +which must be _escaped_ by a preceding `U+005C` character (`\`). ##### String literals @@ -311,6 +311,19 @@ A _string literal_ is a sequence of any Unicode characters enclosed within two which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw string literal_. +A multi-line string literal may be defined by terminating each line with a +`U+005C` character (`\`) immediately before the newline. This causes the +`U+005C` character, the newline, and all whitespace at the beginning of the +next line to be ignored. + +```rust +let a = "foobar"; +let b = "foo\ + bar"; + +assert_eq!(a,b); +``` + ##### Character escapes Some additional _escapes_ are available in either character or non-raw string