Skip to content

Commit 22fd6a6

Browse files
committed
Add regression test
1 parent 3788b7a commit 22fd6a6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)