Skip to content

Commit e39c946

Browse files
Rollup merge of #166146 - GuillaumeGomez:rm-missing_docs, r=clarfonthey
Remove `#[allow(missing_docs)]` where possible Related to #166067. r? @clarfonthey
2 parents 208d6db + 4d86056 commit e39c946

12 files changed

Lines changed: 25 additions & 18 deletions

File tree

‎library/alloc/src/collections/binary_heap/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
//! }
141141
//! ```
142142
143-
#![allow(missing_docs)]
144143
#![stable(feature = "rust1", since = "1.0.0")]
145144

146145
use core::alloc::Allocator;
@@ -1797,6 +1796,7 @@ unsafe impl<I> AsVecIntoIter for IntoIter<I> {
17971796
}
17981797
}
17991798

1799+
/// Iterator which retrieves elements in heap order.
18001800
#[must_use = "iterators are lazy and do nothing unless consumed"]
18011801
#[unstable(feature = "binary_heap_into_iter_sorted", issue = "59278")]
18021802
#[derive(Clone, Debug)]

‎library/alloc/src/io/buffered/bufreader.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ impl<R: ?Sized> BufReader<R> {
299299
impl<R: ?Sized> BufReader<R> {
300300
#[doc(hidden)]
301301
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
302-
#[allow(missing_docs)]
303302
pub fn initialized(&self) -> bool {
304303
self.buf.initialized()
305304
}

‎library/core/src/alloc/layout.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ impl Layout {
600600
note = "Name does not follow std convention, use LayoutError",
601601
suggestion = "LayoutError"
602602
)]
603+
/// Old name of [`LayoutError`].
603604
pub type LayoutErr = LayoutError;
604605

605606
/// The `LayoutError` is returned when the parameters given

‎library/core/src/error.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub trait Error: Debug + Display {
143143
since = "1.33.0",
144144
note = "replaced by Error::source, which can support downcasting"
145145
)]
146-
#[allow(missing_docs)]
146+
/// Replaced by [`Error::source`].
147147
fn cause(&self) -> Option<&dyn Error> {
148148
self.source()
149149
}

‎library/core/src/intrinsics/mod.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,19 @@ use crate::sync::atomic::{
103103
/// A type for atomic ordering parameters for intrinsics. This is a separate type from
104104
/// `atomic::Ordering` so that we can make it `ConstParamTy` and fix the values used here without a
105105
/// risk of leaking that to stable code.
106-
#[allow(missing_docs)]
107106
#[derive(Debug, ConstParamTy, PartialEq, Eq)]
108107
pub enum AtomicOrdering {
109108
// These values must match the compiler's `AtomicOrdering` defined in
110109
// `rustc_middle/src/ty/consts/int.rs`!
110+
/// [`Ordering::Relaxed`][`crate::sync::atomic::Ordering::Relaxed`]
111111
Relaxed = 0,
112+
/// [`Ordering::Release`][`crate::sync::atomic::Ordering::Release`]
112113
Release = 1,
114+
/// [`Ordering::Acquire`][`crate::sync::atomic::Ordering::Acquire`]
113115
Acquire = 2,
116+
/// [`Ordering::AcqRel`][`crate::sync::atomic::Ordering::AcqRel`]
114117
AcqRel = 3,
118+
/// [`Ordering::SeqCst`][`crate::sync::atomic::Ordering::SeqCst`]
115119
SeqCst = 4,
116120
}
117121

‎library/core/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ pub mod future;
343343
pub mod task;
344344

345345
/* Heap memory allocator trait */
346-
#[allow(missing_docs)]
347346
pub mod alloc;
348347

349348
// note: does not need to be public

‎library/core/src/panicking.rs‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//! necessary lang items for the compiler. All panics are funneled through this
2222
//! one function. The actual symbol is declared through the `#[panic_handler]` attribute.
2323
24-
#![allow(dead_code, missing_docs)]
24+
#![allow(dead_code)]
2525
#![unstable(
2626
feature = "panic_internals",
2727
reason = "internal details of the implementation of the `panic!` and related macros",
@@ -182,6 +182,7 @@ macro_rules! panic_const {
182182
// slightly different forms. It's not clear if there's a good way to deduplicate without adding
183183
// special cases to the compiler (e.g., a const generic function wouldn't have a single definition
184184
// shared across crates, which is exactly what we want here).
185+
#[allow(missing_docs)]
185186
pub mod panic_const {
186187
use super::*;
187188
panic_const! {
@@ -233,9 +234,10 @@ pub fn panic_nounwind_nobacktrace(expr: &'static str) -> ! {
233234
panic_nounwind_fmt(fmt::Arguments::from_str(expr), /* force_no_backtrace */ true);
234235
}
235236

237+
/// Needed by `non-fmt-panics` lint.
236238
#[inline]
237239
#[track_caller]
238-
#[rustc_diagnostic_item = "unreachable_display"] // needed for `non-fmt-panics` lint
240+
#[rustc_diagnostic_item = "unreachable_display"]
239241
pub fn unreachable_display<T: fmt::Display>(x: &T) -> ! {
240242
panic_fmt(format_args!("internal error: entered unreachable code: {}", *x));
241243
}
@@ -250,9 +252,10 @@ pub const fn panic_str_2015(expr: &str) -> ! {
250252
panic_display(&expr);
251253
}
252254

255+
/// Needed for const-evaluated panics.
253256
#[inline]
254257
#[track_caller]
255-
#[lang = "panic_display"] // needed for const-evaluated panics
258+
#[lang = "panic_display"]
256259
#[rustc_do_not_const_check] // hooked by const-eval
257260
#[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
258261
pub const fn panic_display<T: fmt::Display>(x: &T) -> ! {
@@ -457,31 +460,31 @@ fn assert_failed_inner(
457460
}
458461
}
459462

460-
// panic!() without args expands to this, to generate slightly less code
463+
/// `panic!()` without args expands to this, to generate slightly less code.
461464
#[cfg_attr(not(panic = "immediate-abort"), inline(never), cold)]
462465
#[cfg_attr(panic = "immediate-abort", inline)]
463466
#[track_caller]
464467
pub const fn panic_default_msg() -> ! {
465468
panic("explicit panic")
466469
}
467470

468-
// unreachable!() without args expands to this, to generate slightly less code
471+
/// `unreachable!()` without args expands to this, to generate slightly less code.
469472
#[cfg_attr(not(panic = "immediate-abort"), inline(never), cold)]
470473
#[cfg_attr(panic = "immediate-abort", inline)]
471474
#[track_caller]
472475
pub const fn unreachable_default_msg() -> ! {
473476
panic("internal error: entered unreachable code")
474477
}
475478

476-
// unimplemented!() without args expands to this, to generate slightly less code
479+
/// `unimplemented!()` without args expands to this, to generate slightly less code.
477480
#[cfg_attr(not(panic = "immediate-abort"), inline(never), cold)]
478481
#[cfg_attr(panic = "immediate-abort", inline)]
479482
#[track_caller]
480483
pub const fn unimplemented_default_msg() -> ! {
481484
panic("not implemented")
482485
}
483486

484-
// todo!() without args expands to this, to generate slightly less code
487+
/// `todo!()` without args expands to this, to generate slightly less code.
485488
#[cfg_attr(not(panic = "immediate-abort"), inline(never), cold)]
486489
#[cfg_attr(panic = "immediate-abort", inline)]
487490
#[track_caller]

‎library/std/src/net/tcp.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,16 +1110,20 @@ impl TcpListener {
11101110
self.0.hop_limit_v6()
11111111
}
11121112

1113+
/// Only allow v6 for this socket.
1114+
///
1115+
/// ⚠️: This option can only be set before the socket is bound.
11131116
#[stable(feature = "net2_mutators", since = "1.9.0")]
11141117
#[deprecated(since = "1.16.0", note = "this option can only be set before the socket is bound")]
1115-
#[allow(missing_docs)]
11161118
pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> {
11171119
self.0.set_only_v6(only_v6)
11181120
}
11191121

1122+
/// Checks if this socket only allow v6.
1123+
///
1124+
/// ⚠️: This option can only be set before the socket is bound.
11201125
#[stable(feature = "net2_mutators", since = "1.9.0")]
11211126
#[deprecated(since = "1.16.0", note = "this option can only be set before the socket is bound")]
1122-
#[allow(missing_docs)]
11231127
pub fn only_v6(&self) -> io::Result<bool> {
11241128
self.0.only_v6()
11251129
}

‎library/std/src/num/f32.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//! defined directly on the `f32` type.
1111
1212
#![stable(feature = "rust1", since = "1.0.0")]
13-
#![allow(missing_docs)]
1413

1514
#[stable(feature = "rust1", since = "1.0.0")]
1615
#[allow(deprecated, clippy::legacy_numeric_constants)]

‎library/std/src/num/f64.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//! defined directly on the `f64` type.
1111
1212
#![stable(feature = "rust1", since = "1.0.0")]
13-
#![allow(missing_docs)]
1413

1514
#[stable(feature = "rust1", since = "1.0.0")]
1615
#[allow(deprecated, clippy::legacy_numeric_constants)]

0 commit comments

Comments
 (0)