about summary refs log tree commit diff
path: root/src/libstd/path
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/path
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/path')
-rw-r--r--src/libstd/path/mod.rs4
-rw-r--r--src/libstd/path/posix.rs4
-rw-r--r--src/libstd/path/windows.rs6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index c8465eb039f..a0097469e56 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -488,8 +488,8 @@ pub trait GenericPathUnsafe {
 
 /// Helper struct for printing paths with format!()
 pub struct Display<'a, P> {
-    priv path: &'a P,
-    priv filename: bool
+    path: &'a P,
+    filename: bool
 }
 
 impl<'a, P: GenericPath> fmt::Show for Display<'a, P> {
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index cb4c830f380..098b3edb69d 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -40,8 +40,8 @@ pub type RevStrComponents<'a> = Map<'a, &'a [u8], Option<&'a str>,
 /// Represents a POSIX file path
 #[deriving(Clone)]
 pub struct Path {
-    priv repr: ~[u8], // assumed to never be empty or contain NULs
-    priv sepidx: Option<uint> // index of the final separator in repr
+    repr: ~[u8], // assumed to never be empty or contain NULs
+    sepidx: Option<uint> // index of the final separator in repr
 }
 
 /// The standard path separator character
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index a641787dfd1..ca9b351210d 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -81,9 +81,9 @@ pub type RevComponents<'a> = Map<'a, Option<&'a str>, &'a [u8],
 // preserved by the data structure; let the Windows API error out on them.
 #[deriving(Clone)]
 pub struct Path {
-    priv repr: ~str, // assumed to never be empty
-    priv prefix: Option<PathPrefix>,
-    priv sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
+    repr: ~str, // assumed to never be empty
+    prefix: Option<PathPrefix>,
+    sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
 }
 
 impl Eq for Path {