]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #9432 : alexcrichton/rust/correct-item-visibility, r=pcwalton
authorbors <bors@rust-lang.org>
Wed, 25 Sep 2013 07:55:53 +0000 (00:55 -0700)
committerbors <bors@rust-lang.org>
Wed, 25 Sep 2013 07:55:53 +0000 (00:55 -0700)
This fixes private statics and functions from being usable cross-crates, along
with some bad privacy error messages. This is a reopening of #8365 with all the
privacy checks in privacy.rs instead of resolve.rs (where they should be
anyway).

These maps of exported items will hopefully get used for generating
documentation by rustdoc

Closes #8592

1  2 
src/librustc/middle/trans/base.rs
src/libsyntax/parse/obsolete.rs
src/libsyntax/parse/parser.rs
src/test/run-pass/default-method-supertrait-vtable.rs

Simple merge
index c2c08ce9360b6256419c3c15c90940f61ccc04c2,fe2aa05584d13335961bf1b6d1f97fed4acc423d..66774cb275bdd3e3b2b16d7e18a33a8d2421cbbd
@@@ -60,12 -59,9 +59,10 @@@ pub enum ObsoleteSyntax 
      ObsoleteNamedExternModule,
      ObsoleteMultipleLocalDecl,
      ObsoleteMutWithMultipleBindings,
-     ObsoleteExternVisibility,
      ObsoleteUnsafeExternFn,
-     ObsoletePrivVisibility,
      ObsoleteTraitFuncVisibility,
      ObsoleteConstPointer,
 +    ObsoleteEmptyImpl,
  }
  
  impl to_bytes::IterBytes for ObsoleteSyntax {
index 5a0ccac2cdbf2161016b0bcdda30b53a37a179f0,c0dcafa8fb2c1a2c349f1a4331754ff38f0cabfa..72e70e11bcbb68ab02218a04a03f241d4f5f1a84
@@@ -3846,15 -3846,8 +3846,10 @@@ impl Parser 
              None
          };
  
-         // Do not allow visibility to be specified.
-         if visibility != ast::inherited {
-             self.obsolete(*self.span, ObsoleteImplVisibility);
-         }
          let mut meths = ~[];
 -        if !self.eat(&token::SEMI) {
 +        if self.eat(&token::SEMI) {
 +            self.obsolete(*self.span, ObsoleteEmptyImpl);
 +        } else {
              self.expect(&token::LBRACE);
              while !self.eat(&token::RBRACE) {
                  meths.push(self.parse_method());
index b5790269d90ce70c05940648c5a1b9bf7420b582,0c6430fb36d09f8c91d79fa811b4bba63cb73942..2bcf264bb1f14c20b38b2f73ec7e879bfcaa2c0f
@@@ -29,8 -29,8 +29,8 @@@ impl Y for int 
      fn y(self) -> int { self }
  }
  
 -impl Z for int;
 +impl Z for int {}
  
- fn main() {
pub fn main() {
      assert_eq!(12.x(), 12);
  }