make LayoutCx
not generic
This commit is contained in:
parent
13b5a4e43b
commit
16be6666d4
9 changed files with 42 additions and 71 deletions
|
@ -21,7 +21,7 @@ use rustc_middle::mir::interpret::{
|
|||
UnsupportedOpInfo, ValidationErrorInfo,
|
||||
};
|
||||
use rustc_middle::ty::layout::{LayoutCx, LayoutOf, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_target::abi::{
|
||||
Abi, FieldIdx, FieldsShape, Scalar as ScalarAbi, Size, VariantIdx, Variants, WrappingRange,
|
||||
|
@ -949,7 +949,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
|
|||
|
||||
/// Helper for recursive traversal: add data ranges of the given type to `out`.
|
||||
fn union_data_range_uncached<'tcx>(
|
||||
cx: &LayoutCx<'tcx, TyCtxt<'tcx>>,
|
||||
cx: &LayoutCx<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
base_offset: Size,
|
||||
out: &mut RangeSet,
|
||||
|
|
|
@ -42,7 +42,7 @@ pub fn check_validity_requirement<'tcx>(
|
|||
/// for details.
|
||||
fn check_validity_requirement_strict<'tcx>(
|
||||
ty: TyAndLayout<'tcx>,
|
||||
cx: &LayoutCx<'tcx, TyCtxt<'tcx>>,
|
||||
cx: &LayoutCx<'tcx>,
|
||||
kind: ValidityRequirement,
|
||||
) -> Result<bool, &'tcx LayoutError<'tcx>> {
|
||||
let machine = CompileTimeMachine::new(CanAccessMutGlobal::No, CheckAlignment::Error);
|
||||
|
@ -80,7 +80,7 @@ fn check_validity_requirement_strict<'tcx>(
|
|||
/// function for details.
|
||||
fn check_validity_requirement_lax<'tcx>(
|
||||
this: TyAndLayout<'tcx>,
|
||||
cx: &LayoutCx<'tcx, TyCtxt<'tcx>>,
|
||||
cx: &LayoutCx<'tcx>,
|
||||
init_kind: ValidityRequirement,
|
||||
) -> Result<bool, &'tcx LayoutError<'tcx>> {
|
||||
let scalar_allows_raw_init = move |s: Scalar| -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue