Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DefKind::Ctor from filtering crate items #3845

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading