Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/simple.rs')
-rw-r--r--crates/hir-ty/src/tests/simple.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/simple.rs b/crates/hir-ty/src/tests/simple.rs
index e7cb7cd417..0c73370a68 100644
--- a/crates/hir-ty/src/tests/simple.rs
+++ b/crates/hir-ty/src/tests/simple.rs
@@ -3612,3 +3612,25 @@ fn main() {
"#,
);
}
+
+#[test]
+fn builtin_format_args() {
+ check_infer(
+ r#"
+#[lang = "format_arguments"]
+pub struct Arguments<'a>;
+fn main() {
+ let are = "are";
+ builtin#format_args("hello {} friends, we {are} {0}{last}", "fancy", last = "!");
+}
+"#,
+ expect![[r#"
+ 65..175 '{ ...!"); }': ()
+ 75..78 'are': &str
+ 81..86 '"are"': &str
+ 92..172 'builti...= "!")': Arguments<'_>
+ 152..159 '"fancy"': &str
+ 168..171 '"!"': &str
+ "#]],
+ );
+}