diff options
author | Jonas Schievink <[email protected]> | 2021-03-17 15:31:54 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-03-17 17:28:27 +0000 |
commit | 6356ea24dd026cc386dace23087cdbce7570f369 (patch) | |
tree | ec13c1fc226705c1b109239ff70c332839a1ef7c /crates/hir_ty | |
parent | 622c780a8ca023f09d57b4fa42608410c477128e (diff) |
Add test for `#[cfg]` on function params
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 50dc40335..9a3258955 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs | |||
@@ -713,4 +713,17 @@ fn main() { | |||
713 | "#, | 713 | "#, |
714 | ); | 714 | ); |
715 | } | 715 | } |
716 | |||
717 | #[test] | ||
718 | fn cfgd_out_fn_params() { | ||
719 | check_diagnostics( | ||
720 | r#" | ||
721 | fn foo(#[cfg(NEVER)] x: ()) {} | ||
722 | |||
723 | fn main() { | ||
724 | foo(); | ||
725 | } | ||
726 | "#, | ||
727 | ) | ||
728 | } | ||
716 | } | 729 | } |