Skip to content

Commit 1aa2d78

Browse files
committed
Auto merge of #155083 - adwinwhite:introduce-unnormalized, r=lcnr
Introduce `Unnormalized` wrapper This is the first step of the [eager normalization](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/Eager.20normalization.2C.20ahoy.21/with/582996293) series. This PR introduce an `Unnormalized` wrapper and make most normalization routines consume it. The purpose is to make normalization explicit. This PR contains no behavior change. API changes are in the first two commit. There're some normalization routines left untouched: - `normalize` in the type checker of borrowck: better do it together with `field.ty()` returning `Unnormalized`. - `normalize_with_depth`: only used inside the old solver. Can be done later. - `query_normalize`: rarely used. - misc local normalization helpers. The compiler errors are mostly fixed via `ast-grep`, with exceptions handled manually.
2 parents d3f6d8c + c5cc84e commit 1aa2d78

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/alloc_addresses/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
170170
{
171171
let fn_sig = this.tcx.instantiate_bound_regions_with_erased(
172172
this.tcx
173-
.fn_sig(instance.def_id())
174-
.instantiate(*this.tcx, instance.args),
173+
.fn_sig(instance.def_id()).instantiate(*this.tcx, instance.args).skip_norm_wip(),
175174
);
176175
let fn_ptr = crate::shims::native_lib::build_libffi_closure(this, fn_sig)?;
177176

src/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
13811381
panic!("extern_statics cannot contain wildcards")
13821382
};
13831383
let info = ecx.get_alloc_info(alloc_id);
1384-
let def_ty = ecx.tcx.type_of(def_id).instantiate_identity();
1384+
let def_ty = ecx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip();
13851385
let extern_decl_layout =
13861386
ecx.tcx.layout_of(ecx.typing_env().as_query_input(def_ty)).unwrap();
13871387
if extern_decl_layout.size != info.size || extern_decl_layout.align.abi != info.align {

0 commit comments

Comments
 (0)