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

Print escaped string if char literal has multiple characters, but only one printable character #90861

Merged
merged 5 commits into from
Nov 17, 2021

Conversation

5225225
Copy link
Contributor

@5225225 5225225 commented Nov 13, 2021

Fixes #90857

I'm not sure about the error message here, it could get rather long and maybe using the names of characters would be better? That wouldn't help the length any, though.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2021
@5225225 5225225 marked this pull request as ready for review November 13, 2021 12:48
@5225225 5225225 changed the title Print full char literal on error if any are non-printing Print escaped string if char literal has multiple characters, but only one printable character Nov 13, 2021
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

I don't think it's too much of an issue that the diagnostic might get long with printing characters, this is a rare case and we're printing what the user wrote, so can't do much about the length. This looks great, thanks!

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 15, 2021

📌 Commit e197392 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 15, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 15, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 15, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 16, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
@JohnTitor
Copy link
Member

Failed in rollup: #90944 (comment)
@bors r-

The entry limit in tidy should be updated.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 16, 2021
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 16, 2021

📌 Commit eee29b0 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 16, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 16, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 16, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 16, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 16, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 17, 2021
Print escaped string if char literal has multiple characters, but only one printable character

Fixes rust-lang#90857

I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 17, 2021
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#89610 (warn on must_use use on async fn's)
 - rust-lang#90667 (Improve diagnostics when a static lifetime is expected)
 - rust-lang#90687 (Permit const panics in stable const contexts in stdlib)
 - rust-lang#90772 (Add Vec::retain_mut)
 - rust-lang#90861 (Print escaped string if char literal has multiple characters, but only one printable character)
 - rust-lang#90884 (Fix span for non-satisfied trivial trait bounds)
 - rust-lang#90900 (Remove workaround for the forward progress handling in LLVM)
 - rust-lang#90901 (Improve ManuallyDrop suggestion)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ab958a7 into rust-lang:master Nov 17, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 17, 2021
@5225225 5225225 deleted the nonprinting-char branch November 17, 2021 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple-character char literal error should mention non-printing characters
6 participants