Skip to content

Commit

Permalink
Remove DefKind::Ctor from filtering crate items (#3845)
Browse files Browse the repository at this point in the history
rust-lang/rust#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.
  • Loading branch information
carolynzech authored Jan 22, 2025
1 parent 511953d commit f8a1488
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 f8a1488

Please sign in to comment.