rust/src/libcollections
bors ef91cdb140 Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis
Some notes:
This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668).

The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325.
The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents).
A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far.

The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!

Obsolete pre-1.0 feature `visible_private_types` is removed.

This is a [breaking-change].
The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325).
I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.
UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually.

Closes https://github.com/rust-lang/rust/issues/28325
Closes https://github.com/rust-lang/rust/issues/28450
Closes https://github.com/rust-lang/rust/issues/29524
Closes https://github.com/rust-lang/rust/issues/29627
Closes https://github.com/rust-lang/rust/issues/29668
Closes https://github.com/rust-lang/rust/issues/30055

r? @nikomatsakis
2015-12-18 18:54:52 +00:00
..
btree Fix the fallout 2015-12-18 04:12:31 +03:00
binary_heap.rs Make BinaryHeap Dijkstra example return Option 2015-12-13 11:40:27 -08:00
borrow.rs rustfmt libcollections 2015-11-24 11:53:47 +13:00
enum_set.rs rustfmt libcollections 2015-11-24 11:53:47 +13:00
fmt.rs Review fixes 2015-11-18 01:24:22 +03:00
lib.rs std: Stabilize APIs for the 1.6 release 2015-12-05 15:09:44 -08:00
linked_list.rs rustfmt libcollections 2015-11-24 11:53:47 +13:00
macros.rs Add note about clone in docs for vec![] 2015-09-07 03:57:20 +05:30
range.rs rustfmt libcollections 2015-11-24 11:53:47 +13:00
slice.rs doc: no need to duplicate docs on renamed API 2015-12-17 21:10:57 +02:00
str.rs Correct 'bye' to 'byte' in str docs. 2015-12-10 13:49:04 -06:00
string.rs Auto merge of #30272 - tshepang:doc-drain, r=bluss 2015-12-18 05:05:09 +00:00
vec.rs Auto merge of #30272 - tshepang:doc-drain, r=bluss 2015-12-18 05:05:09 +00:00
vec_deque.rs Auto merge of #30272 - tshepang:doc-drain, r=bluss 2015-12-18 05:05:09 +00:00