diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-11-24 14:51:48 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-11-24 14:51:48 +0000 |
| commit | 0626de439df0b9bb4e751a92375fdb764c0ee91e (patch) | |
| tree | c30b6de13cfbf637426c69a486d62423bb697a37 /compiler | |
| parent | b06258cde4b0dd131cdbf289349ebf51b3b6388a (diff) | |
| download | rust-0626de439df0b9bb4e751a92375fdb764c0ee91e.tar.gz rust-0626de439df0b9bb4e751a92375fdb764c0ee91e.zip | |
Remove a hack for effects
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_typeck/src/expr.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index a9f67f984da..6d4bd981b7b 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -526,14 +526,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { _ => self.instantiate_value_path(segs, opt_ty, res, expr.span, expr.hir_id).0, }; - if let ty::FnDef(did, callee_args) = *ty.kind() { + if let ty::FnDef(did, _) = *ty.kind() { let fn_sig = ty.fn_sig(tcx); - // HACK: whenever we get a FnDef in a non-const context, enforce effects to get the - // default `host = true` to avoid inference errors later. - if tcx.hir().body_const_context(self.body_id).is_none() { - self.enforce_context_effects(expr.hir_id, qpath.span(), did, callee_args); - } if tcx.fn_sig(did).skip_binder().abi() == RustIntrinsic && tcx.item_name(did) == sym::transmute { |
