about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-20 05:51:48 -0700
committerbors <bors@rust-lang.org>2014-03-20 05:51:48 -0700
commit8e285208d550c41d5060bbc4a614c9b63c3bff6a (patch)
tree8c4ca58b43010ac4bb619df96c7425247e9ba55a /src/libsyntax
parent95ee0a04fd78deb773da2d1b2544696c4f0278c7 (diff)
parent7b19574a2c2faac766c5192b243e5c361e449f3b (diff)
auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakis
`Share` implies that all *reachable* content is *threadsafe*.

Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)...

Fixes #11781
cc #12577 

What this PR will do
================

- [x] Add Share kind and
- [x]  Replace usages of Freeze with Share in bounds.
- [x] Add Unsafe<T> #12577
- [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior

What's left to do in a separate PR (after the snapshot)?
===========================================

- Remove `Freeze` completely 
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs8
-rw-r--r--src/libsyntax/util/interner.rs2
2 files changed, 1 insertions, 9 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index cbf5242271d..fce9ddcc2ee 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1159,14 +1159,6 @@ mod test {
 
     use std::vec::Vec;
 
-    fn is_freeze<T: Freeze>() {}
-
-    // Assert that the AST remains Freeze (#10693).
-    #[test]
-    fn ast_is_freeze() {
-        is_freeze::<Item>();
-    }
-
     // are ASTs encodable?
     #[test]
     fn check_asts_encodable() {
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs
index 8a8bf1fdfb3..0406f5f5ba9 100644
--- a/src/libsyntax/util/interner.rs
+++ b/src/libsyntax/util/interner.rs
@@ -29,7 +29,7 @@ pub struct Interner<T> {
 }
 
 // when traits can extend traits, we should extend index<Name,T> to get []
-impl<T:Eq + Hash + Freeze + Clone + 'static> Interner<T> {
+impl<T: Eq + Hash + Clone + 'static> Interner<T> {
     pub fn new() -> Interner<T> {
         Interner {
             map: RefCell::new(HashMap::new()),