mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
Don't unwrap() in in_std()
This commit is contained in:
+4
-2
@@ -631,8 +631,10 @@ fn check_abi<'a>(&self, abi: Abi, exp_abi: Abi) -> InterpResult<'a, ()> {
|
||||
|
||||
fn in_std(&self) -> bool {
|
||||
let this = self.eval_context_ref();
|
||||
this.tcx.def_path(this.frame().instance.def_id()).krate
|
||||
== this.tcx.def_path(this.tcx.lang_items().start_fn().unwrap()).krate
|
||||
this.tcx.lang_items().start_fn().map_or(false, |start_fn| {
|
||||
this.tcx.def_path(this.frame().instance.def_id()).krate
|
||||
== this.tcx.def_path(start_fn).krate
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user