We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3788b7a commit 22fd6a6Copy full SHA for 22fd6a6
tests/ui/rfcs/rfc-3348-c-string-literals/edition-2015-2018-lexing.rs
@@ -0,0 +1,24 @@
1
+// Regression test for issue #113235.
2
+
3
+// check-pass
4
+// revisions: edition2015 edition2018
5
+//[edition2015] edition: 2015
6
+//[edition2018] edition: 2018
7
8
+// Make sure that in pre-2021 editions we continue to parse the snippet
9
+// `c"hello"` as an identifier followed by a (normal) string literal and
10
+// allow the code below to compile.
11
+// Prefixes including `c` as used by C string literals are only reserved
12
+// in edition 2021 and onward.
13
+//
14
+// Consider checking out rust-2021/reserved-prefixes-migration.rs as well.
15
16
+macro_rules! parse {
17
+ (c $e:expr) => {
18
+ $e
19
+ };
20
+}
21
22
+fn main() {
23
+ let _: &'static str = parse!(c"hello");
24
0 commit comments