From 377b0900aede976b2d37a499bbd7b62c2e39b358 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 27 May 2015 11:18:36 +0300 Subject: Use `const fn` to abstract away the contents of UnsafeCell & friends. --- src/test/debuginfo/constant-debug-locs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/debuginfo') diff --git a/src/test/debuginfo/constant-debug-locs.rs b/src/test/debuginfo/constant-debug-locs.rs index 5fc58075504..72448ca2e00 100644 --- a/src/test/debuginfo/constant-debug-locs.rs +++ b/src/test/debuginfo/constant-debug-locs.rs @@ -19,7 +19,7 @@ // This test makes sure that the compiler doesn't crash when trying to assign // debug locations to const-expressions. -use std::sync::MUTEX_INIT; +use std::sync::StaticMutex; use std::cell::UnsafeCell; const CONSTANT: u64 = 3 + 4; @@ -49,7 +49,7 @@ const VEC: [u32; 8] = [0; 8]; const NESTED: (Struct, TupleStruct) = (STRUCT, TUPLE_STRUCT); -const UNSAFE_CELL: UnsafeCell = UnsafeCell { value: false }; +const UNSAFE_CELL: UnsafeCell = UnsafeCell::new(false); fn main() { let mut _constant = CONSTANT; @@ -61,6 +61,6 @@ fn main() { let mut _string = STRING; let mut _vec = VEC; let mut _nested = NESTED; - let mut _extern = MUTEX_INIT; + let mut _extern = StaticMutex::new(); let mut _unsafe_cell = UNSAFE_CELL; } -- cgit 1.4.1-3-g733a5