]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/macro_expansion_tests/builtin_fn_macro.rs
feat: support concat_bytes
[rust.git] / crates / hir_def / src / macro_expansion_tests / builtin_fn_macro.rs
index 6e91301ecdc896508286d327c77cf170355fe3ff..919dd6c07f039a3c9977ec4870c4779fac429d98 100644 (file)
@@ -313,6 +313,24 @@ macro_rules! concat {}
     );
 }
 
+#[test]
+fn test_concat_bytes_expand() {
+    check(
+        r##"
+#[rustc_builtin_macro]
+macro_rules! concat_bytes {}
+
+fn main() { concat_bytes!(b'A', b"BC", [68, b'E', 70]); }
+"##,
+        expect![[r##"
+#[rustc_builtin_macro]
+macro_rules! concat_bytes {}
+
+fn main() { [b'A', 66, 67, 68, b'E', 70]; }
+"##]],
+    );
+}
+
 #[test]
 fn test_concat_with_captured_expr() {
     check(