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

Clarify rule for end-of-line backslashes in strings #784

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

bgeron
Copy link
Contributor

@bgeron bgeron commented Mar 23, 2020

No description provided.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2020

I think I can see how it can be confusing due to the use of commas, but I think the original intent is: There is a preceding clause which establishes when a continuation happens ("when an unescaped U+005C character (\) occurs immediately before the line-break") and then lists 3 things that are ignored:

  1. The backslash.
  2. The linebreak.
  3. The whitespace at the beginning of the next line.

Reading it that way, this change seems to remove number 2, which seems wrong. Perhaps it can be rewritten to be clearer? Maybe a simple change like this?

 when an unescaped `U+005C` character (`\`) occurs immediately before the
-line-break, the `U+005C` character, the line-break, and all whitespace at the
+line-break, then the `U+005C` character, the line-break, and all whitespace at the
 beginning of the next line are ignored. Thus `a` and `b` are equal:

@bgeron bgeron changed the title Nit: remove erroneous duplication Clarify rule for end-of-line backslashes in strings Mar 23, 2020
@bgeron
Copy link
Contributor Author

bgeron commented Mar 23, 2020

Great find Eric! Integrated your suggestion and changed the PR title.

@bgeron
Copy link
Contributor Author

bgeron commented Mar 23, 2020

Can I just say how happy I am that the Rust community likes to clarify and make small improvements to things, as opposed to other communities with slow processes where things don't get fixed and everyone just accepts the mild snafus

@bgeron
Copy link
Contributor Author

bgeron commented Mar 30, 2020

Ready to be merged, I think!

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 merged commit 89dd146 into rust-lang:master Mar 31, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 31, 2020
Update books.

## reference

2 commits in e2f11fe..89dd146
2020-03-10 06:59:24 +0100 to 2020-03-31 09:42:10 -0700
- Clarify rule for end-of-line backslashes in strings (rust-lang/reference#784)
- Fix and clarify section on re-export (rust-lang/reference#780)

## book

1 commits in 6fb3705e5230311b096d47f7e2c91f9ce24393d0..c8841f2841a2d26124319ddadd1b6a245f9a1856
2020-02-12 13:48:57 -0500 to 2020-03-22 09:07:01 -0500
- Fix broken front_of_house.rs test on nightly. (rust-lang/book#2289)

## rust-by-example

7 commits in cb369ae95ca36b841960182d26f6d5d9b2e3cc18..edd2a7e687358712608896730c083cb76c7b401a
2020-03-14 12:13:22 -0500 to 2020-03-30 09:37:29 -0300
- feat: add doc attributes section to documentation (rust-lang/rust-by-example#1323)
- feat: add playpen topic (rust-lang/rust-by-example#1324)
- feat: add sentence about rustdoc & std library (rust-lang/rust-by-example#1322)
- fix: make spelling/style of rustdoc consistent (rust-lang/rust-by-example#1321)
- Rewrite section on 'static lifetime. (rust-lang/rust-by-example#1320)
- Remove deprecated `std::error::Error` functions and other minor changes (rust-lang/rust-by-example#1319)
- Remove mdbook version flags from README (rust-lang/rust-by-example#1318)

## nomicon

1 commits in 9f797e65e6bcc79419975b17aff8e21c9adc039f..411197b0e77590c967e37e8f6ec681abd359afe8
2020-03-04 03:45:13 +0100 to 2020-03-31 20:46:09 +0200
- Fix negative_impls feature. (rust-lang/nomicon#205)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 31, 2020
Update books.

## reference

2 commits in e2f11fe..89dd146
2020-03-10 06:59:24 +0100 to 2020-03-31 09:42:10 -0700
- Clarify rule for end-of-line backslashes in strings (rust-lang/reference#784)
- Fix and clarify section on re-export (rust-lang/reference#780)

## book

1 commits in 6fb3705e5230311b096d47f7e2c91f9ce24393d0..c8841f2841a2d26124319ddadd1b6a245f9a1856
2020-02-12 13:48:57 -0500 to 2020-03-22 09:07:01 -0500
- Fix broken front_of_house.rs test on nightly. (rust-lang/book#2289)

## rust-by-example

7 commits in cb369ae95ca36b841960182d26f6d5d9b2e3cc18..edd2a7e687358712608896730c083cb76c7b401a
2020-03-14 12:13:22 -0500 to 2020-03-30 09:37:29 -0300
- feat: add doc attributes section to documentation (rust-lang/rust-by-example#1323)
- feat: add playpen topic (rust-lang/rust-by-example#1324)
- feat: add sentence about rustdoc & std library (rust-lang/rust-by-example#1322)
- fix: make spelling/style of rustdoc consistent (rust-lang/rust-by-example#1321)
- Rewrite section on 'static lifetime. (rust-lang/rust-by-example#1320)
- Remove deprecated `std::error::Error` functions and other minor changes (rust-lang/rust-by-example#1319)
- Remove mdbook version flags from README (rust-lang/rust-by-example#1318)

## nomicon

1 commits in 9f797e65e6bcc79419975b17aff8e21c9adc039f..411197b0e77590c967e37e8f6ec681abd359afe8
2020-03-04 03:45:13 +0100 to 2020-03-31 20:46:09 +0200
- Fix negative_impls feature. (rust-lang/nomicon#205)
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