Skip to content

Commit 0626de4

Browse files
committed
Remove a hack for effects
1 parent b06258c commit 0626de4

File tree

1 file changed

+1
-6
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+1
-6
lines changed

Diff for: compiler/rustc_hir_typeck/src/expr.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -526,14 +526,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
526526
_ => self.instantiate_value_path(segs, opt_ty, res, expr.span, expr.hir_id).0,
527527
};
528528

529-
if let ty::FnDef(did, callee_args) = *ty.kind() {
529+
if let ty::FnDef(did, _) = *ty.kind() {
530530
let fn_sig = ty.fn_sig(tcx);
531531

532-
// HACK: whenever we get a FnDef in a non-const context, enforce effects to get the
533-
// default `host = true` to avoid inference errors later.
534-
if tcx.hir().body_const_context(self.body_id).is_none() {
535-
self.enforce_context_effects(expr.hir_id, qpath.span(), did, callee_args);
536-
}
537532
if tcx.fn_sig(did).skip_binder().abi() == RustIntrinsic
538533
&& tcx.item_name(did) == sym::transmute
539534
{

0 commit comments

Comments
 (0)