diff --git a/src/libextra/term.rs b/src/libextra/term.rs index e74a0f4e18e..455cc0b7450 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -57,7 +57,7 @@ pub struct Terminal { } #[cfg(not(target_os = "win32"))] -pub impl Terminal { +impl Terminal { pub fn new(out: @io::Writer) -> Result { let term = os::getenv("TERM"); if term.is_none() { @@ -81,7 +81,7 @@ pub fn new(out: @io::Writer) -> Result { return Ok(Terminal {out: out, ti: inf, color_supported: cs}); } - fn fg(&self, color: u8) { + pub fn fg(&self, color: u8) { if self.color_supported { let s = expand(*self.ti.strings.find_equiv(&("setaf")).unwrap(), [Number(color as int)], [], []); @@ -92,7 +92,7 @@ fn fg(&self, color: u8) { } } } - fn bg(&self, color: u8) { + pub fn bg(&self, color: u8) { if self.color_supported { let s = expand(*self.ti.strings.find_equiv(&("setab")).unwrap(), [Number(color as int)], [], []); @@ -103,7 +103,7 @@ fn bg(&self, color: u8) { } } } - fn reset(&self) { + pub fn reset(&self) { if self.color_supported { let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], [], []); if s.is_ok() { @@ -116,17 +116,17 @@ fn reset(&self) { } #[cfg(target_os = "win32")] -pub impl Terminal { +impl Terminal { pub fn new(out: @io::Writer) -> Result { return Ok(Terminal {out: out, color_supported: false}); } - fn fg(&self, color: u8) { + pub fn fg(&self, color: u8) { } - fn bg(&self, color: u8) { + pub fn bg(&self, color: u8) { } - fn reset(&self) { + pub fn reset(&self) { } } diff --git a/src/librustpkg/package_id.rs b/src/librustpkg/package_id.rs index ca0210f469b..85c82787f26 100644 --- a/src/librustpkg/package_id.rs +++ b/src/librustpkg/package_id.rs @@ -35,8 +35,8 @@ pub struct PkgId { version: Version } -pub impl PkgId { - fn new(s: &str) -> PkgId { +impl PkgId { + pub fn new(s: &str) -> PkgId { use conditions::bad_pkg_id::cond; let p = Path(s); @@ -57,13 +57,13 @@ fn new(s: &str) -> PkgId { } } - fn hash(&self) -> ~str { + pub fn hash(&self) -> ~str { fmt!("%s-%s-%s", self.remote_path.to_str(), hash(self.remote_path.to_str() + self.version.to_str()), self.version.to_str()) } - fn short_name_with_version(&self) -> ~str { + pub fn short_name_with_version(&self) -> ~str { fmt!("%s-%s", self.short_name, self.version.to_str()) } } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index dcb41629958..f694e37d42f 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -440,8 +440,8 @@ pub struct expr { span: span, } -pub impl expr { - fn get_callee_id(&self) -> Option { +impl expr { + pub fn get_callee_id(&self) -> Option { match self.node { expr_method_call(callee_id, _, _, _, _, _) | expr_index(callee_id, _, _) | diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index f11219f6c9e..f37b430b480 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -49,7 +49,7 @@ pub enum ObsoleteSyntax { ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer, ObsoleteMutVector, - ObsoleteTraitImplVisibility, + ObsoleteImplVisibility, ObsoleteRecordType, ObsoleteRecordPattern, ObsoletePostFnTySigil, @@ -158,11 +158,10 @@ pub fn obsolete(&self, sp: span, kind: ObsoleteSyntax) { in a mutable location, like a mutable local variable or an \ `@mut` box" ), - ObsoleteTraitImplVisibility => ( - "visibility-qualified trait implementation", - "`pub` or `priv` is meaningless for trait implementations, \ - because the `impl...for...` form defines overloads for \ - methods that already exist; remove the `pub` or `priv`" + ObsoleteImplVisibility => ( + "visibility-qualified implementation", + "`pub` or `priv` goes on individual functions; remove the \ + `pub` or `priv`" ), ObsoleteRecordType => ( "structural record type", diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f013dfaceba..dd966815ad2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -76,7 +76,7 @@ use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds}; use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax}; use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer}; -use parse::obsolete::{ObsoleteMutVector, ObsoleteTraitImplVisibility}; +use parse::obsolete::{ObsoleteMutVector, ObsoleteImplVisibility}; use parse::obsolete::{ObsoleteRecordType, ObsoleteRecordPattern}; use parse::obsolete::{ObsoletePostFnTySigil}; use parse::obsolete::{ObsoleteBareFnType, ObsoleteNewtypeEnum}; @@ -3305,10 +3305,9 @@ fn parse_item_impl(&self, visibility: ast::visibility) -> item_info { None }; - // Do not allow visibility to be specified in `impl...for...`. It is - // meaningless. - if opt_trait.is_some() && visibility != ast::inherited { - self.obsolete(*self.span, ObsoleteTraitImplVisibility); + // Do not allow visibility to be specified. + if visibility != ast::inherited { + self.obsolete(*self.span, ObsoleteImplVisibility); } let mut meths = ~[]; diff --git a/src/test/auxiliary/reexported_static_methods.rs b/src/test/auxiliary/reexported_static_methods.rs index 88e746585c9..811bf082ae8 100644 --- a/src/test/auxiliary/reexported_static_methods.rs +++ b/src/test/auxiliary/reexported_static_methods.rs @@ -34,7 +34,7 @@ pub struct Boz { unused_str: ~str } - pub impl Boz { + impl Boz { pub fn boz(i: int) -> bool { i > 0 } @@ -45,7 +45,7 @@ pub enum Bort { Bort2 } - pub impl Bort { + impl Bort { pub fn bort() -> ~str { ~"bort()" }