librustc: Forbid private types in public APIs.
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. In its place a `#[feature(visible_private_types)]` gate has been added. Closes #16463. RFC #48. [breaking-change]
This commit is contained in:
parent
43fd619819
commit
e9ad12c0ca
49 changed files with 169 additions and 80 deletions
|
@ -66,7 +66,7 @@ pub struct Timer {
|
|||
inner: Option<Box<Inner>>,
|
||||
}
|
||||
|
||||
struct Inner {
|
||||
pub struct Inner {
|
||||
cb: Option<Box<rtio::Callback + Send>>,
|
||||
interval: u64,
|
||||
repeat: bool,
|
||||
|
@ -74,7 +74,6 @@ struct Inner {
|
|||
id: uint,
|
||||
}
|
||||
|
||||
#[allow(visible_private_types)]
|
||||
pub enum Req {
|
||||
// Add a new timer to the helper thread.
|
||||
NewTimer(Box<Inner>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue