Skip to content

libsyntax: Forbid escapes in the inclusive range \x80-\xff in Unicode characters and strings. #18504

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

Closed
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Nov 1, 2014

Use \u0080-\u00ff instead. ASCII/byte literals are unaffected.

This PR introduces a new function, escape_default, into the ASCII
module. This was necessary for the pretty printer to continue to
function.

RFC #326.

Closes #18062.

[breaking-change]

r? @aturon

@rust-highfive
Copy link
Contributor

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@alexcrichton
Copy link
Member

Hm, it looks like a merge went wrong here and a large number of things were introduced?

@pcwalton
Copy link
Contributor Author

pcwalton commented Nov 1, 2014

@alexcrichton Actually, that was the result of regenerating the Unicode tables. They had to be regenerated in order to compile.

#[deprecated = "Replaced by String::from_utf16_lossy"]
pub fn from_utf16_lossy(v: &[u16]) -> String {
String::from_utf16_lossy(v)
}
Copy link
Member

Choose a reason for hiding this comment

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

I was referring to deprecations like these, they shouldn't have been introduced, right?

@aturon
Copy link
Member

aturon commented Nov 2, 2014

LGTM modulo the re-inclusion of a bunch of removed, previously-deprecated stuff that @alexcrichton pointed out.

Unicode characters and strings.

Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected.

This PR introduces a new function, `escape_default`, into the ASCII
module. This was necessary for the pretty printer to continue to
function.

RFC rust-lang#326.

Closes rust-lang#18062.

[breaking-change]
bors added a commit that referenced this pull request Nov 5, 2014
Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected.

This PR introduces a new function, `escape_default`, into the ASCII
module. This was necessary for the pretty printer to continue to
function.

RFC #326.

Closes #18062.

[breaking-change]

r? @aturon
@bors bors closed this Nov 5, 2014
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.

Restrict "\xXX" to ASCII (0x00 -- 0x7F)
5 participants