diff --git a/src/doc/reference.md b/src/doc/reference.md index 4485704c3d523..6be67fc51447e 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1557,8 +1557,7 @@ warnings are generated, or otherwise "you used a private item of another module and weren't allowed to." By default, everything in Rust is *private*, with one exception. Enum variants -in a `pub` enum are also public by default. You are allowed to alter this -default visibility with the `priv` keyword. When an item is declared as `pub`, +in a `pub` enum are also public by default. When an item is declared as `pub`, it can be thought of as being accessible to the outside world. For example: ``` diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 6cb6df008c1cf..18d0031badb84 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -899,7 +899,7 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) { if let ast::MethodImplItem(ref sig, _) = ii.node { // if the method specifies a visibility, use that, otherwise // inherit the visibility from the impl (so `foo` in `pub impl - // { fn foo(); }` is public, but private in `priv impl { fn + // { fn foo(); }` is public, but private in `impl { fn // foo(); }`). let method_vis = ii.vis.inherit_from(parent_visibility); Some((sig, ii.id, ii.ident, method_vis, ii.span)) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5f76c21492707..a7b1beace51d3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4775,7 +4775,7 @@ impl<'a> Parser<'a> { return self.parse_single_struct_field(Inherited, attrs); } - /// Parse visibility: PUB, PRIV, or nothing + /// Parse visibility: PUB or nothing fn parse_visibility(&mut self) -> PResult { if try!(self.eat_keyword(keywords::Pub)) { Ok(Public) } else { Ok(Inherited) } diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs index c650fc25ee163..c9b684fd65694 100644 --- a/src/test/run-pass/issue-4241.rs +++ b/src/test/run-pass/issue-4241.rs @@ -28,7 +28,7 @@ enum Result { Status(String) } -priv fn parse_data(len: usize, io: @io::Reader) -> Result { +fn parse_data(len: usize, io: @io::Reader) -> Result { let res = if (len > 0) { let bytes = io.read_bytes(len as usize); @@ -42,7 +42,7 @@ priv fn parse_data(len: usize, io: @io::Reader) -> Result { return res; } -priv fn parse_list(len: usize, io: @io::Reader) -> Result { +fn parse_list(len: usize, io: @io::Reader) -> Result { let mut list: ~[Result] = ~[]; for _ in 0..len { let v = match io.read_char() { @@ -55,11 +55,11 @@ priv fn parse_list(len: usize, io: @io::Reader) -> Result { return List(list); } -priv fn chop(s: String) -> String { +fn chop(s: String) -> String { s.slice(0, s.len() - 1).to_string() } -priv fn parse_bulk(io: @io::Reader) -> Result { +fn parse_bulk(io: @io::Reader) -> Result { match from_str::(chop(io.read_line())) { None => panic!(), Some(-1) => Nil, @@ -68,7 +68,7 @@ priv fn parse_bulk(io: @io::Reader) -> Result { } } -priv fn parse_multi(io: @io::Reader) -> Result { +fn parse_multi(io: @io::Reader) -> Result { match from_str::(chop(io.read_line())) { None => panic!(), Some(-1) => Nil, @@ -78,14 +78,14 @@ priv fn parse_multi(io: @io::Reader) -> Result { } } -priv fn parse_int(io: @io::Reader) -> Result { +fn parse_int(io: @io::Reader) -> Result { match from_str::(chop(io.read_line())) { None => panic!(), Some(i) => Int(i) } } -priv fn parse_response(io: @io::Reader) -> Result { +fn parse_response(io: @io::Reader) -> Result { match io.read_char() { '$' => parse_bulk(io), '*' => parse_multi(io), @@ -96,7 +96,7 @@ priv fn parse_response(io: @io::Reader) -> Result { } } -priv fn cmd_to_string(cmd: ~[String]) -> String { +fn cmd_to_string(cmd: ~[String]) -> String { let mut res = "*".to_string(); res.push_str(cmd.len().to_string()); res.push_str("\r\n");