From f8a14885f91e4a5356da4ae94e44ef587624f8a4 Mon Sep 17 00:00:00 2001 From: Carolyn Zech Date: Wed, 22 Jan 2025 09:17:59 -0500 Subject: [PATCH] Remove `DefKind::Ctor` from filtering crate items (#3845) https://github.com/rust-lang/rust/pull/119135 is merged, so we shouldn't need this anymore. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --- kani-compiler/src/kani_middle/reachability.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/kani-compiler/src/kani_middle/reachability.rs b/kani-compiler/src/kani_middle/reachability.rs index b875694fd648..dea7cca60844 100644 --- a/kani-compiler/src/kani_middle/reachability.rs +++ b/kani-compiler/src/kani_middle/reachability.rs @@ -84,16 +84,13 @@ where .iter() .filter_map(|item| { // Only collect monomorphic items. - // TODO: Remove the def_kind check once https://github.com/rust-lang/rust/pull/119135 has been released. - let def_id = rustc_internal::internal(tcx, item.def_id()); - (matches!(tcx.def_kind(def_id), rustc_hir::def::DefKind::Ctor(..)) - || matches!(item.kind(), ItemKind::Fn)) - .then(|| { - Instance::try_from(*item) - .ok() - .and_then(|instance| predicate(tcx, instance).then_some(instance)) - }) - .flatten() + matches!(item.kind(), ItemKind::Fn) + .then(|| { + Instance::try_from(*item) + .ok() + .and_then(|instance| predicate(tcx, instance).then_some(instance)) + }) + .flatten() }) .collect::>() }