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

When attempting to write str with single quote suggest double quotes #46653

Merged
merged 1 commit into from
Dec 15, 2017

Conversation

estebank
Copy link
Contributor

Fix #26101.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank
Copy link
Contributor Author

New output:

@estebank estebank added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2017
@leonardo-m
Copy link

Multi-character character constant (MCCC) as in C are not supported yet in Rust, so this error message makes sense. To define MCCC we can use a macro.

| ^^^^
help: if you meant to write a `str` literal use double quotes instead
|
12 | println!("{", 5);
Copy link
Member

Choose a reason for hiding this comment

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

Where did the } go?

@estebank estebank force-pushed the str-as-ch branch 2 times, most recently from b27612b to 668209f Compare December 11, 2017 18:28
|
12 | println!('●●');
| ^^^^
help: if you meant to write a `str` literal use double quotes instead
Copy link
Member

Choose a reason for hiding this comment

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

if you meant to write a `str` literal, use double quotes

(comma separating conditional clause and consequent)

@estebank estebank force-pushed the str-as-ch branch 2 times, most recently from ec451e2 to e6c606f Compare December 11, 2017 21:28
@petrochenkov
Copy link
Contributor

How I see the best solution - single-quoted strings are actually lexed and recovered as strings sharing common code with double-quoted strings.
@bors r+

@bors
Copy link
Contributor

bors commented Dec 12, 2017

📌 Commit e6c606f has been approved by petrochenkov

@bors
Copy link
Contributor

bors commented Dec 13, 2017

⌛ Testing commit e6c606f00b91f87c8b103a276187befef15aad79 with merge d5c2a3865e84ad54b9f9dc928dd57bc5a416ecf3...

@bors
Copy link
Contributor

bors commented Dec 13, 2017

💔 Test failed - status-travis

@kennytm
Copy link
Member

kennytm commented Dec 13, 2017

@bors retry — http://crosstool-ng.org was down.

@estebank estebank 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 Dec 13, 2017
@bors
Copy link
Contributor

bors commented Dec 15, 2017

🔒 Merge conflict

@estebank
Copy link
Contributor Author

@bors r=petrochenkov

rebased to latest master, no actual merge conflict found

@bors
Copy link
Contributor

bors commented Dec 15, 2017

📌 Commit c60aab2 has been approved by petrochenkov

@bors
Copy link
Contributor

bors commented Dec 15, 2017

⌛ Testing commit c60aab2 with merge 04b2344...

bors added a commit that referenced this pull request Dec 15, 2017
When attempting to write str with single quote suggest double quotes

Fix #26101.
@bors
Copy link
Contributor

bors commented Dec 15, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing 04b2344 to master...

@bors bors merged commit c60aab2 into rust-lang:master Dec 15, 2017
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.

8 participants