Skip to content

Commit

Permalink
Unrolled build for rust-lang#118246
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#118246 - fee1-dead-contrib:rm-hack, r=compiler-errors

Remove a hack for effects

Fallback was implemented in rust-lang#115727, which addresses the inference errors mentioned in the comments.
  • Loading branch information
rust-timer authored Nov 24, 2023
2 parents 4fd68eb + 0626de4 commit fc5d078
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit fc5d078

Please sign in to comment.