Skip to content

Commit 218eae0

Browse files
committed
Publicise types/add #[allow(visible_private_types)] to a variety of places.
There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
1 parent fbdd3b2 commit 218eae0

File tree

13 files changed

+16
-5
lines changed

13 files changed

+16
-5
lines changed

src/libextra/workcache.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#[allow(missing_doc)];
12+
#[allow(visible_private_types)];
1213

1314
use serialize::json;
1415
use serialize::json::ToJson;

src/libgreen/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173

174174
// NB this does *not* include globs, please keep it that way.
175175
#[feature(macro_rules)];
176+
#[allow(visible_private_types)];
176177

177178
use std::mem::replace;
178179
use std::os;

src/libnative/io/timer_other.rs

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct Inner {
7171
id: uint,
7272
}
7373

74+
#[allow(visible_private_types)]
7475
pub enum Req {
7576
// Add a new timer to the helper thread.
7677
NewTimer(~Inner),

src/libnative/io/timer_timerfd.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub struct Timer {
4444
priv on_worker: bool,
4545
}
4646

47+
#[allow(visible_private_types)]
4748
pub enum Req {
4849
NewTimer(libc::c_int, Chan<()>, bool, imp::itimerspec),
4950
RemoveTimer(libc::c_int, Chan<()>),

src/librustc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ This API is completely unstable and subject to change.
3030
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
3131
#[feature(quote)];
3232

33+
#[allow(visible_private_types)];
34+
3335
extern crate extra;
3436
extern crate flate;
3537
extern crate arena;

src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub enum ExternalLocation {
9999
}
100100

101101
/// Different ways an implementor of a trait can be rendered.
102-
enum Implementor {
102+
pub enum Implementor {
103103
/// Paths are displayed specially by omitting the `impl XX for` cruft
104104
PathType(clean::Type),
105105
/// This is the generic representation of a trait implementor, used for

src/librustuv/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ via `close` and `delete` methods.
4141

4242
#[feature(macro_rules)];
4343
#[deny(unused_result, unused_must_use)];
44+
#[allow(visible_private_types)];
4445

4546
#[cfg(test)] extern crate green;
4647

src/libstd/libc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ pub mod types {
11301130
Data4: [BYTE, ..8],
11311131
}
11321132

1133-
struct WSAPROTOCOLCHAIN {
1133+
pub struct WSAPROTOCOLCHAIN {
11341134
ChainLen: c_int,
11351135
ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
11361136
}

src/libstd/rt/local.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub trait Local<Borrowed> {
2424
unsafe fn try_unsafe_borrow() -> Option<*mut Self>;
2525
}
2626

27+
#[allow(visible_private_types)]
2728
impl Local<local_ptr::Borrowed<Task>> for Task {
2829
#[inline]
2930
fn put(value: ~Task) { unsafe { local_ptr::put(value) } }
@@ -127,4 +128,3 @@ mod test {
127128
}
128129

129130
}
130-

src/libstd/rt/local_ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ pub mod native {
366366

367367
#[inline]
368368
#[cfg(not(test))]
369+
#[allow(visible_private_types)]
369370
pub fn maybe_tls_key() -> Option<tls::Key> {
370371
unsafe {
371372
// NB: This is a little racy because, while the key is

src/libstd/rt/unwind.rs

+2
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ fn rust_exception_class() -> uw::_Unwind_Exception_Class {
280280

281281
#[cfg(not(target_arch = "arm"), not(test))]
282282
#[doc(hidden)]
283+
#[allow(visible_private_types)]
283284
pub mod eabi {
284285
use uw = super::libunwind;
285286
use libc::c_int;
@@ -333,6 +334,7 @@ pub mod eabi {
333334
// ARM EHABI uses a slightly different personality routine signature,
334335
// but otherwise works the same.
335336
#[cfg(target_arch = "arm", not(test))]
337+
#[allow(visible_private_types)]
336338
pub mod eabi {
337339
use uw = super::libunwind;
338340
use libc::c_int;

src/libsyntax/abi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum Architecture {
4848
static IntelBits: u32 = (1 << (X86 as uint)) | (1 << (X86_64 as uint));
4949
static ArmBits: u32 = (1 << (Arm as uint));
5050

51-
struct AbiData {
51+
pub struct AbiData {
5252
abi: Abi,
5353

5454
// Name of this ABI as we like it called.
@@ -59,7 +59,7 @@ struct AbiData {
5959
abi_arch: AbiArchitecture
6060
}
6161

62-
enum AbiArchitecture {
62+
pub enum AbiArchitecture {
6363
RustArch, // Not a real ABI (e.g., intrinsic)
6464
AllArch, // An ABI that specifies cross-platform defaults (e.g., "C")
6565
Archs(u32) // Multiple architectures (bitset)

src/libsyntax/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This API is completely unstable and subject to change.
3131
#[feature(quote)];
3232

3333
#[deny(non_camel_case_types)];
34+
#[allow(visible_private_types)];
3435

3536
extern crate serialize;
3637
extern crate term;

0 commit comments

Comments
 (0)