]> git.lizzy.rs Git - rust.git/commit
Move more of the exportation burden into privacy
authorAlex Crichton <alex@alexcrichton.com>
Wed, 20 Nov 2013 23:15:34 +0000 (15:15 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 22 Nov 2013 18:02:10 +0000 (10:02 -0800)
commit93a0dec2029f5c0658478187984eddf3afcc84b3
tree70537191153b6b7055c11c3115c3205df963d020
parenteef913b290f668b4f131ead5be65a1615616426b
Move more of the exportation burden into privacy

I added a test case which does not compile today, and required changes on
privacy's side of things to get right. Additionally, this moves a good bit of
logic which did not belong in reachability into privacy.

All of reachability should solely be responsible for determining what the
reachable surface area of a crate is given the exported surface area (where the
exported surface area is that which is usable by external crates).

Privacy will now correctly figure out what's exported by deeply looking
through reexports. Previously if a module were reexported under another name,
nothing in the module would actually get exported in the executable. I also
consolidated the phases of privacy to be clearer about what's an input to what.
The privacy checking pass no longer uses the notion of an "all public" path, and
the embargo visitor is no longer an input to the checking pass.

Currently the embargo visitor is built as a saturating analysis because it's
unknown what portions of the AST are going to get re-exported.
src/librustc/middle/privacy.rs
src/librustc/middle/reachable.rs
src/test/auxiliary/privacy_reexport.rs [new file with mode: 0644]
src/test/compile-fail/lint-missing-doc.rs
src/test/compile-fail/privacy1.rs
src/test/run-pass/privacy-reexport.rs [new file with mode: 0644]