Skip to content

Commit 6ec6c8a

Browse files
committed
w
1 parent 94dcfce commit 6ec6c8a

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

compiler/rustc_mir_build/src/build/expr/as_operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
123123
match category {
124124
Category::Constant
125125
if matches!(needs_temporary, NeedsTemporary::No)
126-
|| !expr.ty.needs_drop(this.tcx, this.infcx.typing_env(this.param_env)) =>
126+
|| !expr.ty.needs_drop(this.tcx, this.typing_env()) =>
127127
{
128128
let constant = this.as_constant(expr);
129129
block.and(Operand::Constant(Box::new(constant)))

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
197197
{
198198
let discr_ty = adt_def.repr().discr_type().to_ty(this.tcx);
199199
let temp = unpack!(block = this.as_temp(block, scope, source, Mutability::Not));
200-
let layout = this.tcx.layout_of(
201-
this.infcx.typing_env(this.param_env).as_query_input(source_expr.ty),
202-
);
200+
let layout =
201+
this.tcx.layout_of(this.typing_env().as_query_input(source_expr.ty));
203202
let discr = this.temp(discr_ty, source_expr.span);
204203
this.cfg.push_assign(
205204
block,

compiler/rustc_mir_build/src/build/expr/stmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
4242

4343
// Generate better code for things that don't need to be
4444
// dropped.
45-
if lhs_expr.ty.needs_drop(this.tcx, this.infcx.typing_env(this.param_env)) {
45+
if lhs_expr.ty.needs_drop(this.tcx, this.typing_env()) {
4646
let rhs = unpack!(block = this.as_local_rvalue(block, rhs));
4747
let lhs = unpack!(block = this.as_place(block, lhs));
4848
block =

0 commit comments

Comments
 (0)