Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 36542fc

Browse files
committedNov 4, 2024·
waddup gamers, today we're gonna mess up some source code
1 parent 56c6a2f commit 36542fc

File tree

211 files changed

+1764
-1305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+1764
-1305
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,11 +3828,16 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
38283828
if tcx.is_diagnostic_item(sym::deref_method, method_did) {
38293829
let deref_target =
38303830
tcx.get_diagnostic_item(sym::deref_target).and_then(|deref_target| {
3831-
Instance::try_resolve(tcx, self.param_env, deref_target, method_args)
3832-
.transpose()
3831+
Instance::try_resolve(
3832+
tcx,
3833+
self.infcx.typing_env(self.param_env),
3834+
deref_target,
3835+
method_args,
3836+
)
3837+
.transpose()
38333838
});
38343839
if let Some(Ok(instance)) = deref_target {
3835-
let deref_target_ty = instance.ty(tcx, self.param_env);
3840+
let deref_target_ty = instance.ty(tcx, self.infcx.typing_env(self.param_env));
38363841
err.note(format!("borrow occurs due to deref coercion to `{deref_target_ty}`"));
38373842
err.span_note(tcx.def_span(instance.def_id()), "deref defined here");
38383843
}

‎compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
864864

865865
let kind = call_kind(
866866
self.infcx.tcx,
867-
self.param_env,
867+
self.infcx.typing_env(self.param_env),
868868
method_did,
869869
method_args,
870870
*fn_span,

0 commit comments

Comments
 (0)
Please sign in to comment.