From 32fdbbb474b444df6a1d66406bb1ea9710eca69e Mon Sep 17 00:00:00 2001 From: edef Date: Sun, 3 Apr 2016 20:07:45 +0200 Subject: [PATCH] move OutStack's bound to a where clause --- src/context.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index 36e411f..0c38e2c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -53,7 +53,8 @@ impl<'a, Stack> Context<'a, Stack> where Stack: stack::Stack { impl<'i, InStack> Context<'i, InStack> where InStack: stack::Stack { /// Switch to in_ctx, saving the current thread of execution to out_ctx. #[inline(always)] - pub unsafe fn swap<'o, OutStack: stack::Stack>(out_ctx: *mut Context<'o, OutStack>, in_ctx: *const Context<'i, InStack>) { + pub unsafe fn swap<'o, OutStack>(out_ctx: *mut Context<'o, OutStack>, in_ctx: *const Context<'i, InStack>) + where OutStack: stack::Stack { Registers::swap(&mut (*out_ctx).regs, &(*in_ctx).regs) } }