Skip to content

Commit 36542fc

Browse files
committed
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,

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

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

953953
if let Ok(Some(instance)) = ty::Instance::try_resolve(
954954
tcx,
955-
self.param_env,
955+
self.infcx.typing_env(self.param_env),
956956
*fn_did,
957957
self.infcx.resolve_vars_if_possible(args),
958958
) {

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
15821582
// The signature in this call can reference region variables,
15831583
// so erase them before calling a query.
15841584
let output_ty = self.tcx().erase_regions(sig.output());
1585-
if !output_ty.is_privately_uninhabited(self.tcx(), self.param_env) {
1585+
if !output_ty
1586+
.is_privately_uninhabited(self.tcx(), self.infcx.typing_env(self.param_env))
1587+
{
15861588
span_mirbug!(self, term, "call to converging function {:?} w/o dest", sig);
15871589
}
15881590
}

compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
376376
let instance = if let ty::FnDef(def_id, fn_args) = *func.layout().ty.kind() {
377377
let instance = ty::Instance::expect_resolve(
378378
fx.tcx,
379-
ty::ParamEnv::reveal_all(),
379+
ty::TypingEnv::fully_monomorphized(),
380380
def_id,
381381
fn_args,
382382
source_info.span,

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ fn codegen_stmt<'tcx>(
666666
let func_ref = fx.get_function_ref(
667667
Instance::resolve_for_fn_ptr(
668668
fx.tcx,
669+
ty::TypingMode::PostAnalysis,
669670
ParamEnv::reveal_all(),
670671
def_id,
671672
args,

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7878
let cv = fx.monomorphize(constant.const_);
7979
// This cannot fail because we checked all required_consts in advance.
8080
let val = cv
81-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), constant.span)
81+
.eval(fx.tcx, ty::TypingMode::PostAnalysis, ty::ParamEnv::reveal_all(), constant.span)
8282
.expect("erroneous constant missed by mono item collection");
8383
(val, cv.ty())
8484
}

compiler/rustc_codegen_cranelift/src/inline_asm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub(crate) fn codegen_inline_asm_terminator<'tcx>(
9292
if let ty::FnDef(def_id, args) = *const_.ty().kind() {
9393
let instance = ty::Instance::resolve_for_fn_ptr(
9494
fx.tcx,
95+
ty::TypingMode::PostAnalysis,
9596
ty::ParamEnv::reveal_all(),
9697
def_id,
9798
args,
@@ -231,7 +232,7 @@ pub(crate) fn codegen_naked_asm<'tcx>(
231232
ty::EarlyBinder::bind(value.const_),
232233
);
233234
let const_value = cv
234-
.eval(tcx, ty::ParamEnv::reveal_all(), value.span)
235+
.eval(tcx, ty::TypingMode::PostAnalysis, ty::ParamEnv::reveal_all(), value.span)
235236
.expect("erroneous constant missed by mono item collection");
236237

237238
let value = rustc_codegen_ssa::common::asm_const_to_str(
@@ -256,6 +257,7 @@ pub(crate) fn codegen_naked_asm<'tcx>(
256257
if let ty::FnDef(def_id, args) = *const_.ty().kind() {
257258
let instance = ty::Instance::resolve_for_fn_ptr(
258259
tcx,
260+
ty::TypingMode::PostAnalysis,
259261
ty::ParamEnv::reveal_all(),
260262
def_id,
261263
args,

compiler/rustc_codegen_cranelift/src/main_shim.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ pub(crate) fn maybe_create_entry_wrapper(
113113
.unwrap();
114114
let report = Instance::expect_resolve(
115115
tcx,
116+
ty::TypingMode::PostAnalysis,
116117
ParamEnv::reveal_all(),
117118
report.def_id,
118119
tcx.mk_args(&[GenericArg::from(main_ret_ty)]),
@@ -139,6 +140,7 @@ pub(crate) fn maybe_create_entry_wrapper(
139140
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
140141
let start_instance = Instance::expect_resolve(
141142
tcx,
143+
ty::TypingMode::PostAnalysis,
142144
ParamEnv::reveal_all(),
143145
start_def_id,
144146
tcx.mk_args(&[main_ret_ty.into()]),

compiler/rustc_codegen_cranelift/src/unsize.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ pub(crate) fn unsized_info<'tcx>(
2222
target: Ty<'tcx>,
2323
old_info: Option<Value>,
2424
) -> Value {
25-
let (source, target) =
26-
fx.tcx.struct_lockstep_tails_for_codegen(source, target, ParamEnv::reveal_all());
25+
let (source, target) = fx.tcx.struct_lockstep_tails_for_codegen(
26+
source,
27+
target,
28+
ty::TypingEnv::fully_monomorphized(),
29+
);
2730
match (&source.kind(), &target.kind()) {
2831
(&ty::Array(_, len), &ty::Slice(_)) => fx.bcx.ins().iconst(
2932
fx.pointer_type,

0 commit comments

Comments
 (0)