Skip to content

Commit 5bc3c58

Browse files
committed
Add edition supporting C string literals to proc macro UI test
1 parent c4b84e9 commit 5bc3c58

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

tests/ui/proc-macro/auxiliary/api/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// force-host
22
// no-prefer-dynamic
3+
// edition: 2021
34

45
#![crate_type = "proc-macro"]
56
#![crate_name = "proc_macro_api_tests"]
67
#![feature(proc_macro_span)]
78
#![feature(proc_macro_byte_character)]
8-
#![feature(c_str_literals)]
99
#![deny(dead_code)] // catch if a test function is never called
1010

1111
extern crate proc_macro;

tests/ui/proc-macro/auxiliary/api/parse.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ fn test_display_literal() {
1919
"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0",
2020
);
2121

22-
assert_eq!(
23-
Literal::string("a \t ❤ ' \" \u{1}").to_string(),
24-
"\"a \\t ❤ ' \\\" \\u{1}\"",
25-
);
26-
assert_eq!(
27-
Literal::c_string(c"a \t ❤ ' \" \u{1}").to_string(),
28-
"\"a \\t ❤ ' \\\" \\u{1}\"",
29-
);
22+
assert_eq!(Literal::string("a \t ❤ ' \" \u{1}").to_string(), "\"a \\t ❤ ' \\\" \\u{1}\"",);
23+
assert_eq!(Literal::c_string(c"\'\"\x7f\u{7fff}").to_string(), r#"c"\'\"\x7f\xe7\xbf\xbf""#);
3024
assert_eq!(Literal::character('a').to_string(), "'a'");
3125
assert_eq!(Literal::character('\t').to_string(), "'\\t'");
3226
assert_eq!(Literal::character('❤').to_string(), "'❤'");

tests/ui/proc-macro/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// check-pass
22
// aux-build:api/mod.rs
3+
// edition: 2021
34

45
//! This is for everything that *would* be a #[test] inside of libproc_macro,
56
//! except for the fact that proc_macro objects are not capable of existing

0 commit comments

Comments
 (0)