From 931d271b0352ff2525b505811cea11b8941edaa3 Mon Sep 17 00:00:00 2001 From: Urgau Date: Fri, 6 Sep 2024 13:48:17 +0200 Subject: [PATCH] Add missing `#[allow(missing_docs)]` on hack functions in alloc --- alloc/src/slice.rs | 2 ++ alloc/src/string.rs | 1 + std/src/io/buffered/bufreader.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/alloc/src/slice.rs b/alloc/src/slice.rs index 9d70487032699..8cdba166c9dff 100644 --- a/alloc/src/slice.rs +++ b/alloc/src/slice.rs @@ -96,6 +96,7 @@ pub(crate) mod hack { // We shouldn't add inline attribute to this since this is used in // `vec!` macro mostly and causes perf regression. See #71204 for // discussion and perf results. + #[allow(missing_docs)] pub fn into_vec(b: Box<[T], A>) -> Vec { unsafe { let len = b.len(); @@ -105,6 +106,7 @@ pub(crate) mod hack { } #[cfg(not(no_global_oom_handling))] + #[allow(missing_docs)] #[inline] pub fn to_vec(s: &[T], alloc: A) -> Vec { T::to_vec(s, alloc) diff --git a/alloc/src/string.rs b/alloc/src/string.rs index bc8b7e24bf12b..05617669ed231 100644 --- a/alloc/src/string.rs +++ b/alloc/src/string.rs @@ -508,6 +508,7 @@ impl String { // NB see the slice::hack module in slice.rs for more information #[inline] #[cfg(test)] + #[allow(missing_docs)] pub fn from_str(_: &str) -> String { panic!("not available with cfg(test)"); } diff --git a/std/src/io/buffered/bufreader.rs b/std/src/io/buffered/bufreader.rs index cf226bd28d005..035afbb8368b4 100644 --- a/std/src/io/buffered/bufreader.rs +++ b/std/src/io/buffered/bufreader.rs @@ -267,6 +267,7 @@ impl BufReader { // This is only used by a test which asserts that the initialization-tracking is correct. #[cfg(test)] impl BufReader { + #[allow(missing_docs)] pub fn initialized(&self) -> usize { self.buf.initialized() }