From 94b3b32c9882ad206df4f11f2f8de0be70a615f4 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 18 Mar 2021 01:28:40 +0100 Subject: Support `#[cfg]` on all associated items --- crates/hir_ty/src/tests/simple.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index f5069eba5..bcc43ed70 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -2545,3 +2545,22 @@ fn test() { "#]], ) } + +#[test] +fn cfgd_out_assoc_items() { + check_types( + r#" +struct S; + +impl S { + #[cfg(FALSE)] + const C: S = S; +} + +fn f() { + S::C; + //^^^^ {unknown} +} + "#, + ) +} -- cgit v1.2.3