From aeda178011775f4a8e16446341fe4774e02d8f5f Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 23 May 2013 19:12:16 -0700 Subject: librustc: Redo the unsafe checker and make unsafe methods not callable from safe code --- src/libstd/task/spawn.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libstd/task') diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 5941221821a..56b1fb43ff1 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -159,13 +159,17 @@ struct AncestorList(Option>); // Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety. #[inline(always)] fn access_group(x: &TaskGroupArc, blk: &fn(TaskGroupInner) -> U) -> U { - x.with(blk) + unsafe { + x.with(blk) + } } #[inline(always)] fn access_ancestors(x: &Exclusive, blk: &fn(x: &mut AncestorNode) -> U) -> U { - x.with(blk) + unsafe { + x.with(blk) + } } // Iterates over an ancestor list. -- cgit 1.4.1-3-g733a5