]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_ty/src/tests/simple.rs
Support `#[cfg]` on all associated items
[rust.git] / crates / hir_ty / src / tests / simple.rs
index 2947857a5fd29ce37594444e03d9307822c06b2b..bcc43ed700e9376bc8dec6bc69fe356853804dc3 100644 (file)
@@ -1,5 +1,4 @@
 use expect_test::expect;
-use test_utils::mark;
 
 use super::{check_infer, check_types};
 
@@ -2314,7 +2313,7 @@ fn test(t1: Thing) {
 
 #[test]
 fn infer_operator_overload() {
-    mark::check!(infer_expr_inner_binary_operator_overload);
+    cov_mark::check!(infer_expr_inner_binary_operator_overload);
 
     check_infer(
         r#"
@@ -2546,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}
+}
+    "#,
+    )
+}