use TypingEnv when no infcx is available
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
This commit is contained in:
@@ -9,7 +9,7 @@ use tracing::debug;
|
||||
pub fn is_disaligned<'tcx, L>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
local_decls: &L,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
typing_env: ty::TypingEnv<'tcx>,
|
||||
place: Place<'tcx>,
|
||||
) -> bool
|
||||
where
|
||||
@@ -22,8 +22,8 @@ where
|
||||
};
|
||||
|
||||
let ty = place.ty(local_decls, tcx).ty;
|
||||
let unsized_tail = || tcx.struct_tail_for_codegen(ty, param_env);
|
||||
match tcx.layout_of(param_env.and(ty)) {
|
||||
let unsized_tail = || tcx.struct_tail_for_codegen(ty, typing_env);
|
||||
match tcx.layout_of(typing_env.as_query_input(ty)) {
|
||||
Ok(layout)
|
||||
if layout.align.abi <= pack
|
||||
&& (layout.is_sized()
|
||||
|
||||
Reference in New Issue
Block a user