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

string continue non-ASCII whitespace confusing as \x0C is ASCII whitespace #108275

Closed
ModProg opened this issue Feb 20, 2023 · 0 comments · Fixed by #108900
Closed

string continue non-ASCII whitespace confusing as \x0C is ASCII whitespace #108275

ModProg opened this issue Feb 20, 2023 · 0 comments · Fixed by #108900
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ModProg
Copy link
Contributor

ModProg commented Feb 20, 2023

Code

fn main() {
    assert!('\x0c'.is_ascii_whitespace());
    println!("Hello,\
         world!");
}

Current output

warning: non-ASCII whitespace symbol '\u{c}' is not skipped
 --> src/main.rs:3:21
  |
3 |       println!("Hello,\
  |  _____________________^
4 | |
               world!");
  | |      ^- non-ASCII whitespace symbol '\u{c}' is not skipped
  | |______|
  |

Desired output

warning: non-ASCII whitespace symbol '\u{c}' is not skipped
 --> src/main.rs:3:21
  |
3 |       println!("Hello,\
  |  _____________________^
4 | |
               world!");
  | |      ^- '\u{c}' is not skipped, only `\n`, `\r`, `\t` and ` ` are skipped
  | |______|
  |

Rationale and extra context

According to char::is_ascii_whitespace, \x0c is ASCII whitespace.

Other cases

No response

Anything else?

Not sure if this is actually an issue, just an inconsistency I found.

@ModProg ModProg added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 20, 2023
@bors bors closed this as completed in 4ad3230 Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
1 participant