Skip to content

Commit f8a1488

Browse files
authored
Remove DefKind::Ctor from filtering crate items (#3845)
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.
1 parent 511953d commit f8a1488

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

kani-compiler/src/kani_middle/reachability.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,13 @@ where
8484
.iter()
8585
.filter_map(|item| {
8686
// Only collect monomorphic items.
87-
// TODO: Remove the def_kind check once https://github.com/rust-lang/rust/pull/119135 has been released.
88-
let def_id = rustc_internal::internal(tcx, item.def_id());
89-
(matches!(tcx.def_kind(def_id), rustc_hir::def::DefKind::Ctor(..))
90-
|| matches!(item.kind(), ItemKind::Fn))
91-
.then(|| {
92-
Instance::try_from(*item)
93-
.ok()
94-
.and_then(|instance| predicate(tcx, instance).then_some(instance))
95-
})
96-
.flatten()
87+
matches!(item.kind(), ItemKind::Fn)
88+
.then(|| {
89+
Instance::try_from(*item)
90+
.ok()
91+
.and_then(|instance| predicate(tcx, instance).then_some(instance))
92+
})
93+
.flatten()
9794
})
9895
.collect::<Vec<_>>()
9996
}

0 commit comments

Comments
 (0)