Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit 3098bdf

Browse files
committed
Merge pull request #40 from bharrisau/remove_cast
Removes references to cast module.
2 parents a26f8be + f2d6868 commit 3098bdf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/hal/cortex_m3/isr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static ISRCount: uint = 16;
4646

4747
#[link_section=".isr_vector"]
4848
#[no_mangle]
49-
pub static ISRVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
49+
pub static ISRVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
5050
Some(__STACK_BASE),
5151
Some(main), // Reset
5252
Some(isr_nmi), // NMI

src/hal/lpc17xx/isr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static ISRCount: uint = 35;
5757

5858
#[link_section=".isr_vector_nvic"]
5959
#[no_mangle]
60-
pub static NVICVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
60+
pub static NVICVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
6161
// s.a. lpc17xx user manual, table 50 (chapter 6.3)
6262
Some(isr_wdt),
6363
Some(isr_timer_0),

src/lib/volatile_cell.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
1818
use core::kinds::marker;
1919
use core::intrinsics::{volatile_load, volatile_store};
20-
use core::cast::transmute_mut_unsafe;
2120

21+
// TODO(bharrisau) I don't know enough about markers - is it better
22+
// to just use an Unsafe<T> here instead?
2223
pub struct VolatileCell<T> {
2324
value: T,
2425
invariant: marker::InvariantType<T>,
@@ -42,7 +43,7 @@ impl<T> VolatileCell<T> {
4243
#[inline]
4344
pub fn set(&self, value: T) {
4445
unsafe {
45-
volatile_store(&mut (*transmute_mut_unsafe(&self.value)), value)
46+
volatile_store(&self.value as *T as *mut T, value)
4647
}
4748
}
4849
}

src/os/debug.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
//! debug::port provides interface to output structured data over serial port.
1717
18-
use core::mem::size_of;
19-
use core::cast::transmute;
18+
use core::mem::{size_of, transmute};
2019
use core::intrinsics::abort;
2120

2221
use drivers::chario::CharIO;

0 commit comments

Comments
 (0)