From 3397e0bcf14d27fe09ca41ac00dbb9e5c6b332b5 Mon Sep 17 00:00:00 2001 From: edef Date: Tue, 22 Mar 2016 08:46:27 +0100 Subject: [PATCH] at least allow different lifetimes in Context::swap2 Really we should allow swapping between different stack types easily, so we can easily swap between contexts with different stack types. --- src/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index f12b8a8..942852c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -51,7 +51,7 @@ impl<'a, Stack> Context<'a, Stack> where Stack: stack::Stack { /// Switch to in_ctx, saving the current thread of execution to out_ctx. #[inline(always)] - pub unsafe fn swap2(out_ctx: *mut Context<'a, Stack>, in_ctx: *const Context<'a, Stack>) { + pub unsafe fn swap2<'b>(out_ctx: *mut Context<'a, Stack>, in_ctx: *const Context<'b, Stack>) { Registers::swap2(&mut (*out_ctx).regs, &(*in_ctx).regs) }