1
Fork 0

Lifetime variance fixes for rustc

This commit is contained in:
Michael Goulet 2022-05-22 12:48:19 -07:00
parent 4bb4dc4672
commit 1784634a39
22 changed files with 92 additions and 86 deletions

View file

@ -197,7 +197,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
size: Size,
align: Align,
kind: MemoryKind<M::MemoryKind>,
) -> InterpResult<'static, Pointer<M::PointerTag>> {
) -> InterpResult<'tcx, Pointer<M::PointerTag>> {
let alloc = Allocation::uninit(size, align, M::PANIC_ON_ALLOC_FAIL)?;
Ok(self.allocate_raw_ptr(alloc, kind))
}
@ -402,7 +402,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
msg: CheckInAllocMsg,
alloc_size: impl FnOnce(AllocId, Size, M::TagExtra) -> InterpResult<'tcx, (Size, Align, T)>,
) -> InterpResult<'tcx, Option<T>> {
fn check_offset_align(offset: u64, align: Align) -> InterpResult<'static> {
fn check_offset_align<'tcx>(offset: u64, align: Align) -> InterpResult<'tcx> {
if offset % align.bytes() == 0 {
Ok(())
} else {
@ -654,7 +654,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
&self,
id: AllocId,
liveness: AllocCheck,
) -> InterpResult<'static, (Size, Align)> {
) -> InterpResult<'tcx, (Size, Align)> {
// # Regular allocations
// Don't use `self.get_raw` here as that will
// a) cause cycles in case `id` refers to a static

View file

@ -1011,7 +1011,7 @@ where
&mut self,
layout: TyAndLayout<'tcx>,
kind: MemoryKind<M::MemoryKind>,
) -> InterpResult<'static, MPlaceTy<'tcx, M::PointerTag>> {
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>> {
let ptr = self.allocate_ptr(layout.size, layout.align.abi, kind)?;
Ok(MPlaceTy::from_aligned_ptr(ptr.into(), layout))
}