Skip to content

Commit 521ebcb

Browse files
committed
Fixes for Rust 1.61 (the MSRV)
1 parent 7699eef commit 521ebcb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cortex-m/src/psp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ pub struct StackHandle(*mut u32, usize);
1414

1515
impl StackHandle {
1616
/// Get the pointer to the top of the stack
17-
pub const fn top(&mut self) -> *mut u32 {
17+
pub fn top(&mut self) -> *mut u32 {
1818
// SAFETY: The stack was this big when we constructed the handle
1919
unsafe { self.0.add(self.1) }
2020
}
2121

2222
/// Get the pointer to the top of the stack
23-
pub const fn bottom(&mut self) -> *mut u32 {
23+
pub fn bottom(&mut self) -> *mut u32 {
2424
self.0
2525
}
2626
}

testsuite/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mod tests {
9696
let mut handle = super::STACK.take_handle();
9797
let top = handle.top();
9898
let bottom = handle.bottom();
99-
let delta = unsafe { top.byte_offset_from(bottom) };
100-
assert_eq!(delta as usize, super::STACK_SIZE_WORDS * 4);
99+
let delta = unsafe { top.offset_from(bottom) };
100+
assert_eq!(delta as usize, super::STACK_SIZE_WORDS);
101101
}
102102
}

0 commit comments

Comments
 (0)