Skip to content

Commit

Permalink
Fix for hiding of UnsafeCell "value"
Browse files Browse the repository at this point in the history
  • Loading branch information
mokus0 committed Aug 16, 2015
1 parent 5a1bc63 commit adf02aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#![feature(asm, lang_items, plugin, range_inclusive)]
#![feature(core, core_intrinsics, core_prelude, core_slice_ext, core_str_ext)]
#![allow(improper_ctypes)]
#![feature(const_fn)]
#![deny(missing_docs)]
#![no_std]

Expand Down
8 changes: 4 additions & 4 deletions src/os/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ mod internal {

/// Static initializer
pub const MUTEX_INIT: Mutex = Mutex {
owner: UnsafeCell {value: None},
owner: UnsafeCell::new(None),
waiting: Queue {
head: UnsafeCell {value: 0 as *mut Node<*mut TaskDescriptor>,},
tail: UnsafeCell {value: 0 as *mut Node<*mut TaskDescriptor>,},
head: UnsafeCell::new(0 as *mut Node<*mut TaskDescriptor>),
tail: UnsafeCell::new(0 as *mut Node<*mut TaskDescriptor>),
}
};

Expand Down Expand Up @@ -153,7 +153,7 @@ mod internal {
}

/// Static initializer
pub const MUTEX_INIT: Mutex = Mutex { taken: UnsafeCell { value: false } };
pub const MUTEX_INIT: Mutex = Mutex { taken: UnsafeCell::new(false) };

/// A mutex lock
#[must_use]
Expand Down

0 comments on commit adf02aa

Please sign in to comment.