Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/ui/parser/ascii-only-character-escape.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
227 B
Rust
Raw Permalink Normal View History

libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` in 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 #326. Closes #18062. [breaking-change]
2014-10-27 09:13:51 -07:00
fn main() {
Handle `Span`s for byte and raw strings and add more detail
2021-01-23 12:48:31 -08:00
let x = "\x80"; //~ ERROR out of range hex escape
let y = "\xff"; //~ ERROR out of range hex escape
let z = "\xe2"; //~ ERROR out of range hex escape
libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` in 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 #326. Closes #18062. [breaking-change]
2014-10-27 09:13:51 -07:00
let a = b"\x00e2"; // ok because byte literal
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3323ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API