Skip to content

Commit

Permalink
remove the def kind check
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzech committed Jan 21, 2025
1 parent 3138a96 commit 7ac9161
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions kani-compiler/src/kani_middle/reachability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>()
}
Expand Down

0 comments on commit 7ac9161

Please sign in to comment.