From 2fb00c7d85f2eee6caa0bc742afd496a6ef7f33c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 13 Apr 2017 22:57:06 -0500 Subject: fix memory safety hole around `borrow` --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index d49ddf1..46a6bd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,12 +64,15 @@ where /// section /// /// This operation is zero cost and doesn't impose any additional blocking - pub fn borrow<'cs, SCEILING>( + pub fn borrow<'cs, PRIORITY, SCEILING>( &'static self, + _priority: &P, _system_ceiling: &'cs C, ) -> &'cs T where SCEILING: GreaterThanOrEqual, + CEILING: GreaterThanOrEqual, + P: Priority, { unsafe { &*self.data.get() } } @@ -216,12 +219,14 @@ where C: Ceiling, { /// See [Resource.borrow](./struct.Resource.html#method.borrow) - pub fn borrow<'cs, SCEILING>( + pub fn borrow<'cs, PRIORITY, SCEILING>( &'static self, + _priority: &P, _system_ceiling: &'cs C, ) -> &'cs Periph where SCEILING: GreaterThanOrEqual, + CEILING: GreaterThanOrEqual, { unsafe { &*self.peripheral.get() } } -- cgit v1.2.3