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

\0 should be an valid string escape #9143

Closed
Kimundi opened this issue Sep 12, 2013 · 2 comments
Closed

\0 should be an valid string escape #9143

Kimundi opened this issue Sep 12, 2013 · 2 comments

Comments

@Kimundi
Copy link
Member

Kimundi commented Sep 12, 2013

Our strings are utf8, which allow interior nulls. Embedding a null can be, for example, useful for preparing string constants to be used in C fii, assuming no interior nulls exist.

Right now embedding a null is possible as this: "Foo\x00", but I think \0 would deserve to be it's own escape sequence: "Foo\0"

@DanielRosenwasser
Copy link
Contributor

Sent out pull request #9248 to resolve this issue.

@huonw
Copy link
Member

huonw commented Sep 18, 2013

Closed by #9248.

@huonw huonw closed this as completed Sep 18, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 11, 2022
`explicit_auto_deref` changes

fixes rust-lang#9123
fixes rust-lang#9109
fixes rust-lang#9143
fixes rust-lang#9101

This avoid suggesting code which hits a rustc bug. Basically `&{x}` won't use auto-deref if the target type is `Sized`.

changelog: Don't suggest using auto deref for block expressions when the target type is `Sized`
changelog: Include the borrow in the suggestion for `explicit_auto_deref`
changelog: Don't lint `explicit_auto_deref` on `dyn Trait` return
changelog: Don't lint `explicit_auto_deref` when other adjustments are required
changelog: Lint `explicit_auto_deref` in implicit return positions for closures
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

No branches or pull requests

3 participants