Skip to content

Commit 5451010

Browse files
author
hyd-dev
committed
Don't unwrap() in in_std()
1 parent 879000b commit 5451010

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
631631

632632
fn in_std(&self) -> bool {
633633
let this = self.eval_context_ref();
634-
this.tcx.def_path(this.frame().instance.def_id()).krate
635-
== this.tcx.def_path(this.tcx.lang_items().start_fn().unwrap()).krate
634+
this.tcx.lang_items().start_fn().map_or(false, |start_fn| {
635+
this.tcx.def_path(this.frame().instance.def_id()).krate
636+
== this.tcx.def_path(start_fn).krate
637+
})
636638
}
637639
}
638640

0 commit comments

Comments
 (0)