Skip to content

Commit a493fcc

Browse files
committed
use monoitems instead of internalmonoitems
1 parent d2523aa commit a493fcc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

kani-compiler/src/kani_middle/analysis.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use std::fmt::Display;
2525
/// - Total number of MIR instructions.
2626
pub fn print_stats<'tcx>(tcx: TyCtxt<'tcx>, items: &[InternalMonoItem<'tcx>]) {
2727
rustc_internal::run(tcx, || {
28-
let item_types = items.iter().collect::<Counter>();
28+
let item_types: Vec<MonoItem> = items.iter().map(rustc_internal::stable).collect();
29+
let item_types = item_types.iter().collect::<Counter>();
2930
let visitor = items
3031
.iter()
3132
.filter_map(|&mono| {
@@ -120,12 +121,12 @@ impl<T: Into<Key>> FromIterator<T> for Counter {
120121
#[derive(Debug, Eq, Hash, PartialEq)]
121122
struct Key(pub &'static str);
122123

123-
impl<'tcx> From<&InternalMonoItem<'tcx>> for Key {
124-
fn from(value: &InternalMonoItem) -> Self {
124+
impl From<&MonoItem> for Key {
125+
fn from(value: &stable_mir::mir::mono::MonoItem) -> Self {
125126
match value {
126-
InternalMonoItem::Fn(_) => Key("function"),
127-
InternalMonoItem::GlobalAsm(_) => Key("global assembly"),
128-
InternalMonoItem::Static(_) => Key("static item"),
127+
MonoItem::Fn(_) => Key("function"),
128+
MonoItem::GlobalAsm(_) => Key("global assembly"),
129+
MonoItem::Static(_) => Key("static item"),
129130
}
130131
}
131132
}

0 commit comments

Comments
 (0)