about summary refs log tree commit diff
path: root/src/libstd/hash
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/libstd/hash
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/libstd/hash')
-rw-r--r--src/libstd/hash/sip.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/hash/sip.rs b/src/libstd/hash/sip.rs
index d448f4eeb37..d780c30d850 100644
--- a/src/libstd/hash/sip.rs
+++ b/src/libstd/hash/sip.rs
@@ -36,15 +36,15 @@ use super::{Hash, Hasher};
 
 /// `SipState` computes a SipHash 2-4 hash over a stream of bytes.
 pub struct SipState {
-    priv k0: u64,
-    priv k1: u64,
-    priv length: uint, // how many bytes we've processed
-    priv v0: u64,      // hash state
-    priv v1: u64,
-    priv v2: u64,
-    priv v3: u64,
-    priv tail: [u8, ..8], // unprocessed bytes
-    priv ntail: uint,  // how many bytes in tail are valid
+    k0: u64,
+    k1: u64,
+    length: uint, // how many bytes we've processed
+    v0: u64,      // hash state
+    v1: u64,
+    v2: u64,
+    v3: u64,
+    tail: [u8, ..8], // unprocessed bytes
+    ntail: uint,  // how many bytes in tail are valid
 }
 
 // sadly, these macro definitions can't appear later,
@@ -231,8 +231,8 @@ impl Default for SipState {
 /// `SipHasher` computes the SipHash algorithm from a stream of bytes.
 #[deriving(Clone)]
 pub struct SipHasher {
-    priv k0: u64,
-    priv k1: u64,
+    k0: u64,
+    k1: u64,
 }
 
 impl SipHasher {