diff options
| author | bors <bors@rust-lang.org> | 2014-04-03 18:41:45 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-03 18:41:45 -0700 |
| commit | c2e457686b77a7eec906549b73feba314667235b (patch) | |
| tree | 7502e270074fa24186b7599ee78ec4116cd96261 /src/libsyntax | |
| parent | e7fe20722904cd2829a65f845ee7a1718cdf7292 (diff) | |
| parent | 922dcfdc6950f4d68d3334199de5572eef52b75a (diff) | |
| download | rust-c2e457686b77a7eec906549b73feba314667235b.tar.gz rust-c2e457686b77a7eec906549b73feba314667235b.zip | |
auto merge of #13237 : alexcrichton/rust/private-tuple-structs, r=brson
This is the final commit need to implement [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md), it makes all tuple struct fields private by default, overridable with the `pub` keyword. I'll note one divergence from the original RFC which is outlined in the first commit.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ast_map.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 4612f8e6673..53d2ac97b49 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -493,10 +493,10 @@ pub enum Expr_ { ExprVstore(@Expr, ExprVstore), // First expr is the place; second expr is the value. ExprBox(@Expr, @Expr), - ExprVec(Vec<@Expr> , Mutability), - ExprCall(@Expr, Vec<@Expr> ), - ExprMethodCall(Ident, Vec<P<Ty>> , Vec<@Expr> ), - ExprTup(Vec<@Expr> ), + ExprVec(Vec<@Expr>, Mutability), + ExprCall(@Expr, Vec<@Expr>), + ExprMethodCall(Ident, Vec<P<Ty>>, Vec<@Expr>), + ExprTup(Vec<@Expr>), ExprBinary(BinOp, @Expr, @Expr), ExprUnary(UnOp, @Expr), ExprLit(@Lit), @@ -508,14 +508,14 @@ pub enum Expr_ { // Conditionless loop (can be exited with break, cont, or ret) // FIXME #6993: change to Option<Name> ExprLoop(P<Block>, Option<Ident>), - ExprMatch(@Expr, Vec<Arm> ), + ExprMatch(@Expr, Vec<Arm>), ExprFnBlock(P<FnDecl>, P<Block>), ExprProc(P<FnDecl>, P<Block>), ExprBlock(P<Block>), ExprAssign(@Expr, @Expr), ExprAssignOp(BinOp, @Expr, @Expr), - ExprField(@Expr, Ident, Vec<P<Ty>> ), + ExprField(@Expr, Ident, Vec<P<Ty>>), ExprIndex(@Expr, @Expr), /// Expression that looks like a "name". For example, diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index e098dcd99fd..cf584ff62ac 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -66,7 +66,7 @@ impl<'a> Iterator<PathElem> for LinkedPath<'a> { // HACK(eddyb) move this into libstd (value wrapper for slice::Items). #[deriving(Clone)] -pub struct Values<'a, T>(slice::Items<'a, T>); +pub struct Values<'a, T>(pub slice::Items<'a, T>); impl<'a, T: Copy> Iterator<T> for Values<'a, T> { fn next(&mut self) -> Option<T> { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 0d2492d7fad..7cadce54765 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -33,13 +33,13 @@ pub trait Pos { /// A byte offset. Keep this small (currently 32-bits), as AST contains /// a lot of them. #[deriving(Clone, Eq, TotalEq, Hash, Ord, Show)] -pub struct BytePos(u32); +pub struct BytePos(pub u32); /// A character offset. Because of multibyte utf8 characters, a byte offset /// is not equivalent to a character offset. The CodeMap will convert BytePos /// values to CharPos values as necessary. #[deriving(Eq, Hash, Ord, Show)] -pub struct CharPos(uint); +pub struct CharPos(pub uint); // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix // have been unsuccessful |
