Skip to content

Commit 0000db5

Browse files
committed
Sync from rust c67326b
2 parents 0763382 + 47abd3a commit 0000db5

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

example/mini_core.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
rustc_attrs,
99
transparent_unions,
1010
auto_traits,
11+
freeze_impls,
1112
thread_local
1213
)]
1314
#![no_core]

src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ fn codegen_stmt<'tcx>(
779779
NullOp::OffsetOf(fields) => {
780780
layout.offset_of_subfield(fx, fields.iter()).bytes()
781781
}
782-
NullOp::DebugAssertions => {
782+
NullOp::UbCheck(_) => {
783783
let val = fx.tcx.sess.opts.debug_assertions;
784784
let val = CValue::by_val(
785785
fx.bcx.ins().iconst(types::I8, i64::try_from(val).unwrap()),

src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7171
// This cannot fail because we checked all required_consts in advance.
7272
let val = cv
7373
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
74-
.expect("erroneous constant not captured by required_consts");
74+
.expect("erroneous constant missed by mono item collection");
7575
(val, cv.ty())
7676
}
7777

src/main_shim.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,12 @@ pub(crate) fn maybe_create_entry_wrapper(
115115
termination_trait,
116116
)
117117
.unwrap();
118-
let report = Instance::resolve(
118+
let report = Instance::expect_resolve(
119119
tcx,
120120
ParamEnv::reveal_all(),
121121
report.def_id,
122122
tcx.mk_args(&[GenericArg::from(main_ret_ty)]),
123123
)
124-
.unwrap()
125-
.unwrap()
126124
.polymorphize(tcx);
127125

128126
let report_name = tcx.symbol_name(report).name;
@@ -142,14 +140,12 @@ pub(crate) fn maybe_create_entry_wrapper(
142140
}
143141
} else if is_main_fn {
144142
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
145-
let start_instance = Instance::resolve(
143+
let start_instance = Instance::expect_resolve(
146144
tcx,
147145
ParamEnv::reveal_all(),
148146
start_def_id,
149147
tcx.mk_args(&[main_ret_ty.into()]),
150148
)
151-
.unwrap()
152-
.unwrap()
153149
.polymorphize(tcx);
154150
let start_func_id = import_function(tcx, m, start_instance);
155151

0 commit comments

Comments
 (0)