Skip to content

Commit 20ff89f

Browse files
Fix invalid private types in public APIs
1 parent 8515a7c commit 20ff89f

File tree

11 files changed

+44
-17
lines changed

11 files changed

+44
-17
lines changed

library/core/src/error.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ mod tests;
77
use crate::any::{Demand, Provider, TypeId};
88
use crate::fmt::{Debug, Display};
99

10+
#[doc(hidden)]
11+
pub use private::Internal;
12+
1013
/// `Error` is a trait representing the basic expectations for error values,
1114
/// i.e., values of type `E` in [`Result<T, E>`].
1215
///
@@ -205,8 +208,8 @@ where
205208
}
206209

207210
mod private {
208-
// This is a hack to prevent `type_id` from being overridden by `Error`
209-
// implementations, since that can enable unsound downcasting.
211+
/// This is a hack to prevent `type_id` from being overridden by `Error`
212+
/// implementations, since that can enable unsound downcasting.
210213
#[unstable(feature = "error_type_id", issue = "60784")]
211214
#[derive(Debug)]
212215
pub struct Internal;

library/core/src/iter/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ pub use self::range::Step;
390390
reason = "generators are unstable"
391391
)]
392392
pub use self::sources::from_generator;
393+
#[unstable(
394+
feature = "iter_from_generator",
395+
issue = "43122",
396+
reason = "generators are unstable"
397+
)]
398+
#[doc(hidden)]
399+
pub use self::sources::FromGenerator;
393400
#[stable(feature = "iter_empty", since = "1.2.0")]
394401
pub use self::sources::{empty, Empty};
395402
#[stable(feature = "iter_from_fn", since = "1.34.0")]

library/core/src/iter/sources.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ pub use self::from_fn::{from_fn, FromFn};
3232
reason = "generators are unstable"
3333
)]
3434
pub use self::from_generator::from_generator;
35+
#[unstable(
36+
feature = "iter_from_generator",
37+
issue = "43122",
38+
reason = "generators are unstable"
39+
)]
40+
#[doc(hidden)]
41+
pub use self::from_generator::FromGenerator;
3542

3643
#[stable(feature = "iter_successors", since = "1.34.0")]
3744
pub use self::successors::{successors, Successors};

library/core/src/num/dec2flt/lemire.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Implementation of the Eisel-Lemire algorithm.
22
3-
use crate::num::dec2flt::common::BiasedFp;
3+
#[doc(hidden)]
4+
pub use crate::num::dec2flt::common::BiasedFp;
45
use crate::num::dec2flt::float::RawFloat;
56
use crate::num::dec2flt::table::{
67
LARGEST_POWER_OF_FIVE, POWER_OF_FIVE_128, SMALLEST_POWER_OF_FIVE,

library/core/src/str/lossy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ impl<'a> Utf8Chunk<'a> {
6969
}
7070
}
7171

72+
/// Utility struct for debug printing `Utf8Chunks`.
7273
#[must_use]
7374
#[unstable(feature = "str_internals", issue = "none")]
7475
pub struct Debug<'a>(&'a [u8]);

library/core/src/str/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ pub mod pattern;
2424

2525
mod lossy;
2626
#[unstable(feature = "utf8_chunks", issue = "99543")]
27+
#[doc(hidden)]
28+
pub use lossy::Debug;
29+
#[unstable(feature = "utf8_chunks", issue = "99543")]
2730
pub use lossy::{Utf8Chunk, Utf8Chunks};
2831

2932
#[stable(feature = "rust1", since = "1.0.0")]

library/portable-simd/crates/core_simd/src/masks.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ where
107107
}
108108
}
109109

110+
#[cfg(not(all(target_arch = "x86_64", target_feature = "avx512f")))]
111+
impl<T, const LANES: usize> core::convert::From<Mask<T, LANES>> for Simd<T, LANES>
112+
where
113+
T: MaskElement,
114+
LaneCount<LANES>: SupportedLaneCount,
115+
{
116+
fn from(value: Mask<T, LANES>) -> Self {
117+
value.0.0
118+
}
119+
}
120+
110121
impl<T, const LANES: usize> Mask<T, LANES>
111122
where
112123
T: MaskElement,

library/portable-simd/crates/core_simd/src/masks/full_masks.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::simd::{LaneCount, Simd, SupportedLaneCount, ToBitMask};
88
use crate::simd::ToBitMaskArray;
99

1010
#[repr(transparent)]
11-
pub struct Mask<T, const LANES: usize>(Simd<T, LANES>)
11+
pub struct Mask<T, const LANES: usize>(pub(super) Simd<T, LANES>)
1212
where
1313
T: MaskElement,
1414
LaneCount<LANES>: SupportedLaneCount;
@@ -257,16 +257,6 @@ where
257257
}
258258
}
259259

260-
impl<T, const LANES: usize> core::convert::From<Mask<T, LANES>> for Simd<T, LANES>
261-
where
262-
T: MaskElement,
263-
LaneCount<LANES>: SupportedLaneCount,
264-
{
265-
fn from(value: Mask<T, LANES>) -> Self {
266-
value.0
267-
}
268-
}
269-
270260
impl<T, const LANES: usize> core::ops::BitAnd for Mask<T, LANES>
271261
where
272262
T: MaskElement,

library/proc_macro/src/bridge/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ pub mod server;
155155
#[allow(unsafe_code)]
156156
mod symbol;
157157

158-
use buffer::Buffer;
158+
#[doc(hidden)]
159+
pub use buffer::Buffer;
159160
pub use rpc::PanicMessage;
160161
use rpc::{Decode, DecodeMut, Encode, Reader, Writer};
161162

library/proc_macro/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ pub mod bridge;
4040

4141
mod diagnostic;
4242

43+
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
44+
#[doc(hidden)]
45+
pub use diagnostic::Children;
4346
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
4447
pub use diagnostic::{Diagnostic, Level, MultiSpan};
4548

library/test/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// Public reexports
2727
pub use self::bench::{black_box, Bencher};
2828
pub use self::console::run_tests_console;
29+
pub use self::event::{CompletedTest, TestEvent};
2930
pub use self::options::{ColorConfig, Options, OutputFormat, RunIgnored, ShouldPanic};
3031
pub use self::types::TestName::*;
3132
pub use self::types::*;
@@ -43,7 +44,7 @@ pub mod test {
4344
options::{Options, RunIgnored, RunStrategy, ShouldPanic},
4445
run_test, test_main, test_main_static,
4546
test_result::{TestResult, TrFailed, TrFailedMsg, TrIgnored, TrOk},
46-
time::{TestExecTime, TestTimeOptions},
47+
time::{TestExecTime, TestTimeOptions, TimeThreshold},
4748
types::{
4849
DynTestFn, DynTestName, StaticBenchFn, StaticTestFn, StaticTestName, TestDesc,
4950
TestDescAndFn, TestId, TestName, TestType,
@@ -81,7 +82,6 @@ mod types;
8182
mod tests;
8283

8384
use core::any::Any;
84-
use event::{CompletedTest, TestEvent};
8585
use helpers::concurrency::get_concurrency;
8686
use helpers::exit_code::get_exit_code;
8787
use helpers::shuffle::{get_shuffle_seed, shuffle_tests};

0 commit comments

Comments
 (0)