Skip to content
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

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

mattheww
Copy link
Contributor

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".


> **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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit.

Suggested change
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.

Copy link
Contributor Author

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.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss added this pull request to the merge queue Jan 30, 2024
Merged via the queue into rust-lang:master with commit 9329dc4 Jan 30, 2024
1 check passed
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2024
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)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2024
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)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2024
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)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 13, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants