]> git.lizzy.rs Git - rust.git/blobdiff - src/doc/rust.md
Deprecate the bytes!() macro.
[rust.git] / src / doc / rust.md
index cc41b8edfbf8d888a63a32e0a249e2eda6d0ec32..7e5e5b2e67a43be2c92e2f6d9c78d02b38d3db32 100644 (file)
@@ -378,6 +378,19 @@ the characters `U+0022` (double-quote) (except when followed by at least as
 many `U+0023` (`#`) characters as were used to start the raw string literal) or
 `U+005C` (`\`) do not have any special meaning.
 
+Examples for byte string literals:
+
+~~~~
+b"foo"; br"foo";                     // foo
+b"\"foo\""; br#""foo""#;             // "foo"
+
+b"foo #\"# bar";
+br##"foo #"# bar"##;                 // foo #"# bar
+
+b"\x52"; b"R"; br"R";                // R
+b"\\x52"; br"\x52";                  // \x52
+~~~~
+
 #### Number literals
 
 ~~~~ {.ebnf .gram}