Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/patterns.rs')
-rw-r--r--crates/hir-ty/src/tests/patterns.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/patterns.rs b/crates/hir-ty/src/tests/patterns.rs
index 1c1f7055ef..57866acc06 100644
--- a/crates/hir-ty/src/tests/patterns.rs
+++ b/crates/hir-ty/src/tests/patterns.rs
@@ -1126,6 +1126,23 @@ fn var_args() {
pub struct VaListImpl<'f>;
fn my_fn(foo: ...) {}
//^^^ VaListImpl<'?>
+fn my_fn2(bar: u32, foo: ...) {}
+ //^^^ VaListImpl<'?>
+"#,
+ );
+}
+
+#[test]
+fn var_args_cond() {
+ check_types(
+ r#"
+#[lang = "va_list"]
+pub struct VaListImpl<'f>;
+fn my_fn(bar: u32, #[cfg(FALSE)] foo: ..., #[cfg(not(FALSE))] foo: u32) {
+ foo;
+ //^^^ u32
+
+}
"#,
);
}