Sync from rust c67326b063
This commit is contained in:
commit
0000db58c6
@ -8,6 +8,7 @@
|
||||
rustc_attrs,
|
||||
transparent_unions,
|
||||
auto_traits,
|
||||
freeze_impls,
|
||||
thread_local
|
||||
)]
|
||||
#![no_core]
|
||||
|
@ -779,7 +779,7 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
NullOp::OffsetOf(fields) => {
|
||||
layout.offset_of_subfield(fx, fields.iter()).bytes()
|
||||
}
|
||||
NullOp::DebugAssertions => {
|
||||
NullOp::UbCheck(_) => {
|
||||
let val = fx.tcx.sess.opts.debug_assertions;
|
||||
let val = CValue::by_val(
|
||||
fx.bcx.ins().iconst(types::I8, i64::try_from(val).unwrap()),
|
||||
|
@ -71,7 +71,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
|
||||
// This cannot fail because we checked all required_consts in advance.
|
||||
let val = cv
|
||||
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
|
||||
.expect("erroneous constant not captured by required_consts");
|
||||
.expect("erroneous constant missed by mono item collection");
|
||||
(val, cv.ty())
|
||||
}
|
||||
|
||||
|
@ -115,14 +115,12 @@ fn create_entry_fn(
|
||||
termination_trait,
|
||||
)
|
||||
.unwrap();
|
||||
let report = Instance::resolve(
|
||||
let report = Instance::expect_resolve(
|
||||
tcx,
|
||||
ParamEnv::reveal_all(),
|
||||
report.def_id,
|
||||
tcx.mk_args(&[GenericArg::from(main_ret_ty)]),
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.polymorphize(tcx);
|
||||
|
||||
let report_name = tcx.symbol_name(report).name;
|
||||
@ -142,14 +140,12 @@ fn create_entry_fn(
|
||||
}
|
||||
} else if is_main_fn {
|
||||
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
|
||||
let start_instance = Instance::resolve(
|
||||
let start_instance = Instance::expect_resolve(
|
||||
tcx,
|
||||
ParamEnv::reveal_all(),
|
||||
start_def_id,
|
||||
tcx.mk_args(&[main_ret_ty.into()]),
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.polymorphize(tcx);
|
||||
let start_func_id = import_function(tcx, m, start_instance);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user