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

Raise default edition of rust-lang/rust test files to 2021 #1621

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Apr 15, 2024

Without this, rustc's parser fails to parse files containing C-string literal syntax (#1502). For example this file: https://github.com/rust-lang/rust/blob/1.77.0/src/tools/clippy/tests/ui/needless_raw_string_hashes.rs. In edition 2018, it fails with this error:

error: unknown character escape: `a`
  --> src/main.rs:13:10
   |
13 |     cr#"\aaa"#;
   |          ^ unknown character escape
   |
   = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
   |
13 |     cr#r"\aaa"#;
   |        ~~~~~~~

error: unknown start of token: \
  --> src/main.rs:19:9
   |
19 |         \a
   |         ^

error[E0765]: unterminated double quote string
  --> src/main.rs:25:19
   |
25 |       r#"hello world"#;
   |  ___________________^
26 | | }
   | |_^

@dtolnay dtolnay merged commit 1212586 into master Apr 15, 2024
29 checks passed
@dtolnay dtolnay deleted the edition branch April 15, 2024 00:53
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.

None yet

1 participant