-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C string literal expressions #1457
C string literal expressions #1457
Conversation
This is now covered in literal-expr.md
src/expressions/literal-expr.md
Outdated
|
||
> **Note**: the permitted forms of [C_STRING_LITERAL] and [RAW_C_STRING_LITERAL] tokens ensure that the represented bytes never include a zero byte. | ||
|
||
The expression's value is a reference to a statically allocated [Cstr] whose array of bytes contains the represented bytes followed by a zero byte. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor nit.
The expression's value is a reference to a statically allocated [Cstr] whose array of bytes contains the represented bytes followed by a zero byte. | |
The expression's value is a reference to a statically allocated [CStr] whose array of bytes contains the represented bytes followed by a null byte. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed 'zero byte' to 'null byte' in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Update books ## rust-lang/edition-guide 1 commits in baafacc6d8701269dab1e1e333f3547fb54b5a59..76bd48a273a0e0413a3bf22c699112d41497b99e 2024-02-10 20:50:34 UTC to 2024-02-10 20:50:34 UTC - Set up scaffolding for 2024 (rust-lang/edition-guide#288) ## rust-lang/reference 4 commits in a0b119535e7740f68494c4f0582f7ad008b00ccd..8227666de13f6e7bb32dea9dc42e841adb5ce4b7 2024-02-12 03:04:15 UTC to 2024-01-30 20:10:53 UTC - Fix a typo in external-blocks.md (rust-lang/reference#1467) - Fix syntax in `'static lifetime elision` section of `lifetime-elision.md` (rust-lang/reference#1463) - Fix markdown backslash for FLOAT_LITERAL (rust-lang/reference#1464) - C string literal expressions (rust-lang/reference#1457) ## rust-lang/rust-by-example 5 commits in 179256a445d6144f5f371fdefb993f48f33978b0..e188d5d466f7f3ff9f1d518393235f4fe951be46 2024-02-07 17:16:00 UTC to 2024-01-31 17:34:10 UTC - Update macros.md (rust-lang/rust-by-example#1815) - Update borrow.md (rust-lang/rust-by-example#1814) - Fixes the bug: rust-lang/rust-by-example#1721 (rust-lang/rust-by-example#1811) - std_misc/process/pipe.md: Fix typo in pangram string (rust-lang/rust-by-example#1809) - Add expected error behavior into docs (rust-lang/rust-by-example#1810) ## rust-lang/rustc-dev-guide 9 commits in ec287e332777627185be4798ad22599ffe7b84aa..1f30cc7cca9a3433bc1872abdc98960b36c21ca0 2024-02-11 05:36:15 UTC to 2024-01-29 19:49:51 UTC - fix sentence (rust-lang/rustc-dev-guide#1882) - Some updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1883) - Rename occurrences of 'delay_span_bug' to 'span_delayed_bug' (rust-lang/rustc-dev-guide#1881) - Update for upcoming markdown changes. (rust-lang/rustc-dev-guide#1880) - Update uses of renamed BoxMeUp to PanicPayload (rust-lang/rustc-dev-guide#1878) - Add links for arena and interning. (rust-lang/rustc-dev-guide#1868) - Improving macro expansion section (rust-lang/rustc-dev-guide#1875) - Replace letters by foo, bar and buz in lexing example (rust-lang/rustc-dev-guide#1870) - Fix some broken links (rust-lang/rustc-dev-guide#1877)
Update books ## rust-lang/edition-guide 1 commits in baafacc6d8701269dab1e1e333f3547fb54b5a59..76bd48a273a0e0413a3bf22c699112d41497b99e 2024-02-10 20:50:34 UTC to 2024-02-10 20:50:34 UTC - Set up scaffolding for 2024 (rust-lang/edition-guide#288) ## rust-lang/reference 4 commits in a0b119535e7740f68494c4f0582f7ad008b00ccd..8227666de13f6e7bb32dea9dc42e841adb5ce4b7 2024-02-12 03:04:15 UTC to 2024-01-30 20:10:53 UTC - Fix a typo in external-blocks.md (rust-lang/reference#1467) - Fix syntax in `'static lifetime elision` section of `lifetime-elision.md` (rust-lang/reference#1463) - Fix markdown backslash for FLOAT_LITERAL (rust-lang/reference#1464) - C string literal expressions (rust-lang/reference#1457) ## rust-lang/rust-by-example 5 commits in 179256a445d6144f5f371fdefb993f48f33978b0..e188d5d466f7f3ff9f1d518393235f4fe951be46 2024-02-07 17:16:00 UTC to 2024-01-31 17:34:10 UTC - Update macros.md (rust-lang/rust-by-example#1815) - Update borrow.md (rust-lang/rust-by-example#1814) - Fixes the bug: rust-lang/rust-by-example#1721 (rust-lang/rust-by-example#1811) - std_misc/process/pipe.md: Fix typo in pangram string (rust-lang/rust-by-example#1809) - Add expected error behavior into docs (rust-lang/rust-by-example#1810) ## rust-lang/rustc-dev-guide 9 commits in ec287e332777627185be4798ad22599ffe7b84aa..1f30cc7cca9a3433bc1872abdc98960b36c21ca0 2024-02-11 05:36:15 UTC to 2024-01-29 19:49:51 UTC - fix sentence (rust-lang/rustc-dev-guide#1882) - Some updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1883) - Rename occurrences of 'delay_span_bug' to 'span_delayed_bug' (rust-lang/rustc-dev-guide#1881) - Update for upcoming markdown changes. (rust-lang/rustc-dev-guide#1880) - Update uses of renamed BoxMeUp to PanicPayload (rust-lang/rustc-dev-guide#1878) - Add links for arena and interning. (rust-lang/rustc-dev-guide#1868) - Improving macro expansion section (rust-lang/rustc-dev-guide#1875) - Replace letters by foo, bar and buz in lexing example (rust-lang/rustc-dev-guide#1870) - Fix some broken links (rust-lang/rustc-dev-guide#1877)
Rollup merge of rust-lang#120979 - rustbot:docs-update, r=ehuss Update books ## rust-lang/edition-guide 1 commits in baafacc6d8701269dab1e1e333f3547fb54b5a59..76bd48a273a0e0413a3bf22c699112d41497b99e 2024-02-10 20:50:34 UTC to 2024-02-10 20:50:34 UTC - Set up scaffolding for 2024 (rust-lang/edition-guide#288) ## rust-lang/reference 4 commits in a0b119535e7740f68494c4f0582f7ad008b00ccd..8227666de13f6e7bb32dea9dc42e841adb5ce4b7 2024-02-12 03:04:15 UTC to 2024-01-30 20:10:53 UTC - Fix a typo in external-blocks.md (rust-lang/reference#1467) - Fix syntax in `'static lifetime elision` section of `lifetime-elision.md` (rust-lang/reference#1463) - Fix markdown backslash for FLOAT_LITERAL (rust-lang/reference#1464) - C string literal expressions (rust-lang/reference#1457) ## rust-lang/rust-by-example 5 commits in 179256a445d6144f5f371fdefb993f48f33978b0..e188d5d466f7f3ff9f1d518393235f4fe951be46 2024-02-07 17:16:00 UTC to 2024-01-31 17:34:10 UTC - Update macros.md (rust-lang/rust-by-example#1815) - Update borrow.md (rust-lang/rust-by-example#1814) - Fixes the bug: rust-lang/rust-by-example#1721 (rust-lang/rust-by-example#1811) - std_misc/process/pipe.md: Fix typo in pangram string (rust-lang/rust-by-example#1809) - Add expected error behavior into docs (rust-lang/rust-by-example#1810) ## rust-lang/rustc-dev-guide 9 commits in ec287e332777627185be4798ad22599ffe7b84aa..1f30cc7cca9a3433bc1872abdc98960b36c21ca0 2024-02-11 05:36:15 UTC to 2024-01-29 19:49:51 UTC - fix sentence (rust-lang/rustc-dev-guide#1882) - Some updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1883) - Rename occurrences of 'delay_span_bug' to 'span_delayed_bug' (rust-lang/rustc-dev-guide#1881) - Update for upcoming markdown changes. (rust-lang/rustc-dev-guide#1880) - Update uses of renamed BoxMeUp to PanicPayload (rust-lang/rustc-dev-guide#1878) - Add links for arena and interning. (rust-lang/rustc-dev-guide#1868) - Improving macro expansion section (rust-lang/rustc-dev-guide#1875) - Replace letters by foo, bar and buz in lexing example (rust-lang/rustc-dev-guide#1870) - Fix some broken links (rust-lang/rustc-dev-guide#1877)
Update books ## rust-lang/edition-guide 1 commits in baafacc6d8701269dab1e1e333f3547fb54b5a59..76bd48a273a0e0413a3bf22c699112d41497b99e 2024-02-10 20:50:34 UTC to 2024-02-10 20:50:34 UTC - Set up scaffolding for 2024 (rust-lang/edition-guide#288) ## rust-lang/reference 4 commits in a0b119535e7740f68494c4f0582f7ad008b00ccd..8227666de13f6e7bb32dea9dc42e841adb5ce4b7 2024-02-12 03:04:15 UTC to 2024-01-30 20:10:53 UTC - Fix a typo in external-blocks.md (rust-lang/reference#1467) - Fix syntax in `'static lifetime elision` section of `lifetime-elision.md` (rust-lang/reference#1463) - Fix markdown backslash for FLOAT_LITERAL (rust-lang/reference#1464) - C string literal expressions (rust-lang/reference#1457) ## rust-lang/rust-by-example 5 commits in 179256a445d6144f5f371fdefb993f48f33978b0..e188d5d466f7f3ff9f1d518393235f4fe951be46 2024-02-07 17:16:00 UTC to 2024-01-31 17:34:10 UTC - Update macros.md (rust-lang/rust-by-example#1815) - Update borrow.md (rust-lang/rust-by-example#1814) - Fixes the bug: rust-lang/rust-by-example#1721 (rust-lang/rust-by-example#1811) - std_misc/process/pipe.md: Fix typo in pangram string (rust-lang/rust-by-example#1809) - Add expected error behavior into docs (rust-lang/rust-by-example#1810) ## rust-lang/rustc-dev-guide 9 commits in ec287e332777627185be4798ad22599ffe7b84aa..1f30cc7cca9a3433bc1872abdc98960b36c21ca0 2024-02-11 05:36:15 UTC to 2024-01-29 19:49:51 UTC - fix sentence (rust-lang/rustc-dev-guide#1882) - Some updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1883) - Rename occurrences of 'delay_span_bug' to 'span_delayed_bug' (rust-lang/rustc-dev-guide#1881) - Update for upcoming markdown changes. (rust-lang/rustc-dev-guide#1880) - Update uses of renamed BoxMeUp to PanicPayload (rust-lang/rustc-dev-guide#1878) - Add links for arena and interning. (rust-lang/rustc-dev-guide#1868) - Improving macro expansion section (rust-lang/rustc-dev-guide#1875) - Replace letters by foo, bar and buz in lexing example (rust-lang/rustc-dev-guide#1870) - Fix some broken links (rust-lang/rustc-dev-guide#1877)
I'm not sure whether "a reference to a statically allocated [Cstr] whose array of bytes contains" is the right thing to say.
The description of the "unescaping" has come out uglier than the other cases. Maybe there will be a way to do better when it comes to documenting rfc3349.
I think this finishes #939 as far as the Literal expressions page is concerned, but there's more to be done before we can say "the token literals chapter just describes the tokens".