about summary refs log tree commit diff
path: root/src/libregex
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/libregex
parent3f299ff19ddb3ee4752e6db120689189ab4c4231 (diff)
parente9ad12c0cae5c43ada6641c7dc840a0fbe5010a2 (diff)
downloadrust-3941d3c3942a4360bcce4635bfdb33f8382d8f2e.tar.gz
rust-3941d3c3942a4360bcce4635bfdb33f8382d8f2e.zip
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/libregex')
-rw-r--r--src/libregex/compile.rs1
-rw-r--r--src/libregex/re.rs4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs
index 91c3da00162..14d32ed6eaa 100644
--- a/src/libregex/compile.rs
+++ b/src/libregex/compile.rs
@@ -10,7 +10,6 @@
 
 // Enable this to squash warnings due to exporting pieces of the representation
 // for use with the regex! macro. See lib.rs for explanation.
-#![allow(visible_private_types)]
 
 use std::cmp;
 use parse;
diff --git a/src/libregex/re.rs b/src/libregex/re.rs
index c2578d227ee..32a88cfb76d 100644
--- a/src/libregex/re.rs
+++ b/src/libregex/re.rs
@@ -102,7 +102,6 @@ pub fn is_match(regex: &str, text: &str) -> Result<bool, parse::Error> {
 /// More details about the `regex!` macro can be found in the `regex` crate
 /// documentation.
 #[deriving(Clone)]
-#[allow(visible_private_types)]
 pub enum Regex {
     // The representation of `Regex` is exported to support the `regex!`
     // syntax extension. Do not rely on it.
@@ -516,7 +515,6 @@ impl Regex {
     }
 
     #[doc(hidden)]
-    #[allow(visible_private_types)]
     #[experimental]
     pub fn names_iter<'a>(&'a self) -> NamesIter<'a> {
         match *self {
@@ -534,7 +532,7 @@ impl Regex {
 
 }
 
-enum NamesIter<'a> {
+pub enum NamesIter<'a> {
     NamesIterNative(::std::slice::Items<'a, Option<&'static str>>),
     NamesIterDynamic(::std::slice::Items<'a, Option<String>>)
 }