{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/29973","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/29973/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/29973/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/29973/events","html_url":"https://github.com/rust-lang/rust/pull/29973","id":118206528,"number":29973,"title":"privacy: Rewrite VisiblePrivateTypesVisitor","user":{"login":"petrochenkov","id":5751617,"avatar_url":"https://avatars.githubusercontent.com/u/5751617?v=3","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"milestone":null,"comments":27,"created_at":"2015-11-21T16:23:43Z","updated_at":"2015-12-04T18:52:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/29973","html_url":"https://github.com/rust-lang/rust/pull/29973","diff_url":"https://github.com/rust-lang/rust/pull/29973.diff","patch_url":"https://github.com/rust-lang/rust/pull/29973.patch"},"body":"Some notes:\r\nThis 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).\r\n\r\nThe 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.\r\nThe 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).\r\nA 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.\r\n\r\nThe new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!\r\n\r\nObsolete pre-1.0 feature `visible_private_types` is removed.\r\n\r\nThis is a [breaking-change].\r\nThe 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).\r\nI need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.\r\n\r\nCloses https://github.com/rust-lang/rust/issues/28325\r\nCloses https://github.com/rust-lang/rust/issues/28450\r\nCloses https://github.com/rust-lang/rust/issues/29524\r\nCloses https://github.com/rust-lang/rust/issues/29627\r\nCloses https://github.com/rust-lang/rust/issues/29668\r\n\r\nr? @nikomatsakis "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/162049925","html_url":"https://github.com/rust-lang/rust/pull/29973#issuecomment-162049925","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/29973","id":162049925,"user":{"login":"petrochenkov","id":5751617,"avatar_url":"https://avatars.githubusercontent.com/u/5751617?v=3","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T18:52:27Z","updated_at":"2015-12-04T18:52:27Z","body":"Updated with comments addressed."}}