about summary refs log tree commit diff
path: root/src/libworkcache
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-31 15:51:33 -0700
committerbors <bors@rust-lang.org>2014-03-31 15:51:33 -0700
commitb8ef9fd9c9f642ce7b8aed82782a1ed745d08d64 (patch)
tree1e66451d207e19694d62608a8e1724c71796dc00 /src/libworkcache
parenta7e057d402a345f547e67a326871621472d04035 (diff)
parent37a3131640d0fa2633aa26db7f849d110250ce51 (diff)
downloadrust-b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64.tar.gz
rust-b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64.zip
auto merge of #13184 : alexcrichton/rust/priv-fields, r=brson
This is an implementation of a portion of [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md). This PR makes named struct fields private by default (as opposed to inherited by default).

The only real meaty change is the first commit to `rustc`, all other commits are just fallout of that change.

Summary of changes made:

* Named fields are private by default *everywhere*
* The `priv` keyword is now default-deny on named fields (done in a "lint" pass in privacy)

Changes yet to be done (before the RFC is closed)

* Change tuple structs to have private fields by default
* Remove `priv` enum variants
* Make `priv` a reserved keyword
Diffstat (limited to 'src/libworkcache')
-rw-r--r--src/libworkcache/lib.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs
index a078a770e86..571f4340120 100644
--- a/src/libworkcache/lib.rs
+++ b/src/libworkcache/lib.rs
@@ -140,9 +140,9 @@ impl WorkMap {
 }
 
 pub struct Database {
-    priv db_filename: Path,
-    priv db_cache: TreeMap<~str, ~str>,
-    db_dirty: bool
+    db_filename: Path,
+    db_cache: TreeMap<~str, ~str>,
+    pub db_dirty: bool,
 }
 
 impl Database {
@@ -225,26 +225,26 @@ pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
 
 #[deriving(Clone)]
 pub struct Context {
-    db: Arc<RWLock<Database>>,
-    priv cfg: Arc<json::Object>,
+    pub db: Arc<RWLock<Database>>,
+    cfg: Arc<json::Object>,
     /// Map from kinds (source, exe, url, etc.) to a freshness function.
     /// The freshness function takes a name (e.g. file path) and value
     /// (e.g. hash of file contents) and determines whether it's up-to-date.
     /// For example, in the file case, this would read the file off disk,
     /// hash it, and return the result of comparing the given hash and the
     /// read hash for equality.
-    priv freshness: Arc<FreshnessMap>
+    freshness: Arc<FreshnessMap>
 }
 
 pub struct Prep<'a> {
-    priv ctxt: &'a Context,
-    priv fn_name: &'a str,
-    priv declared_inputs: WorkMap,
+    ctxt: &'a Context,
+    fn_name: &'a str,
+    declared_inputs: WorkMap,
 }
 
 pub struct Exec {
-    priv discovered_inputs: WorkMap,
-    priv discovered_outputs: WorkMap
+    discovered_inputs: WorkMap,
+    discovered_outputs: WorkMap
 }
 
 enum Work<'a, T> {