Skip to content

Commit 3402675

Browse files
committed
exported_symbols_cache: ensure we do not overwrite anything
1 parent 9b57313 commit 3402675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
194194

195195
let instance = instance_and_crate.map(|ic| ic.0);
196196
// Cache it and load its MIR, if found.
197-
this.machine.exported_symbols_cache.insert(link_name, instance);
197+
this.machine.exported_symbols_cache.try_insert(link_name, instance).unwrap();
198198
instance.map(|instance| this.load_mir(instance.def, None)).transpose()
199199
}
200200

0 commit comments

Comments
 (0)