diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-17 14:12:39 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-17 14:12:39 +0000 |
commit | baa19991688c6bdd99b63b8dc6f539be44da0350 (patch) | |
tree | 7d68e1721571b164e3ea702ee2fe031d119f0168 /crates/hir_ty/src | |
parent | 0fbfab3b45af7a02b1224bca4a53e9b8f6ec049e (diff) | |
parent | cb530e7c97508c55bc5553ea7d9fe1e07d4a1b36 (diff) |
Merge #8066
8066: Handle `#[cfg]` on call arguments r=jonas-schievink a=jonas-schievink
This resolved the issue reported in this comment: https://github.com/rust-analyzer/rust-analyzer/issues/5649#issuecomment-789424608
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 71b2cade0..50dc40335 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs | |||
@@ -690,4 +690,27 @@ fn main() { | |||
690 | "#, | 690 | "#, |
691 | ) | 691 | ) |
692 | } | 692 | } |
693 | |||
694 | #[test] | ||
695 | fn cfgd_out_call_arguments() { | ||
696 | check_diagnostics( | ||
697 | r#" | ||
698 | struct C(#[cfg(FALSE)] ()); | ||
699 | impl C { | ||
700 | fn new() -> Self { | ||
701 | Self( | ||
702 | #[cfg(FALSE)] | ||
703 | (), | ||
704 | ) | ||
705 | } | ||
706 | |||
707 | fn method(&self) {} | ||
708 | } | ||
709 | |||
710 | fn main() { | ||
711 | C::new().method(#[cfg(FALSE)] 0); | ||
712 | } | ||
713 | "#, | ||
714 | ); | ||
715 | } | ||
693 | } | 716 | } |