mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
Fix incorrect handling of cfg'd varargs
This commit is contained in:
parent
9cbafa2d49
commit
f2fa456a8c
8 changed files with 37 additions and 16 deletions
|
|
@ -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
|
||||
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue