about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-23 04:15:37 +0000
committerbors <bors@rust-lang.org>2014-09-23 04:15:37 +0000
commit3941d3c3942a4360bcce4635bfdb33f8382d8f2e (patch)
treeb5c58d05d48b523da9c0abf058fb3139c60173d2 /src/libcore
parent3f299ff19ddb3ee4752e6db120689189ab4c4231 (diff)
parente9ad12c0cae5c43ada6641c7dc840a0fbe5010a2 (diff)
auto merge of #17401 : pcwalton/rust/private-items-in-public-apis, r=alexcrichton
This breaks code like:

    struct Foo {
        ...
    }

    pub fn make_foo() -> Foo {
        ...
    }

Change this code to:

    pub struct Foo {    // note `pub`
        ...
    }

    pub fn make_foo() -> Foo {
        ...
    }

The `visible_private_types` lint has been removed, since it is now an
error to attempt to expose a private type in a public API.

Closes #16463.

RFC #48.

[breaking-change]

r? @alexcrichton 
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/any.rs2
-rw-r--r--src/libcore/iter.rs1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index 625b89b3bae..fb70cb5b752 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -94,7 +94,7 @@ pub enum Void { }
 pub trait Any: AnyPrivate {}
 
 /// An inner trait to ensure that only this module can call `get_type_id()`.
-trait AnyPrivate {
+pub trait AnyPrivate {
     /// Get the `TypeId` of `self`
     fn get_type_id(&self) -> TypeId;
 }
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 6bee0573fac..f84c5eec452 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2178,7 +2178,6 @@ pub type Iterate<'a, T> = Unfold<'a, T, IterateState<'a, T>>;
 
 /// Creates a new iterator that produces an infinite sequence of
 /// repeated applications of the given function `f`.
-#[allow(visible_private_types)]
 pub fn iterate<'a, T: Clone>(seed: T, f: |T|: 'a -> T) -> Iterate<'a, T> {
     Unfold::new((f, Some(seed), true), |st| {
         let &(ref mut f, ref mut val, ref mut first) = st;