From fe04c28b5928469bd1e0df48091d80e998da5920 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 2 Mar 2020 14:05:21 +0800 Subject: Add test --- crates/ra_hir_ty/src/tests/macros.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/ra_hir_ty/src/tests') diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 53cd81d46..55386c030 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs @@ -419,6 +419,25 @@ fn main() { ); } +#[test] +fn infer_builtin_macros_concat() { + assert_snapshot!( + infer(r#" +#[rustc_builtin_macro] +macro_rules! concat {() => {}} + +fn main() { + let x = concat!("hello", concat!("world", "!")); +} +"#), + @r###" + ![0; 13) '"helloworld!"': &str + [66; 122) '{ ...")); }': () + [76; 77) 'x': &str + "### + ); +} + #[test] fn infer_derive_clone_simple() { let (db, pos) = TestDB::with_position( -- cgit v1.2.3