Skip to content

Commit 14ebca5

Browse files
committed
Rollup merge of rust-lang#56941 - euclio:deny-libstd-resolution-failures, r=QuietMisdreavus
deny intra-doc link resolution failures in libstd Fixes rust-lang#56693. Until we land a fix for the underlying issue (rust-lang#56922), we can at least fix the failures in libstd so they don't propagate to downstream crates.
2 parents 314e61f + 82e55c1 commit 14ebca5

File tree

9 files changed

+24
-3
lines changed

9 files changed

+24
-3
lines changed

src/liballoc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
7373
#![no_std]
7474
#![needs_allocator]
75+
76+
#![deny(intra_doc_link_resolution_failure)]
7577
#![deny(missing_debug_implementations)]
7678

7779
#![cfg_attr(not(test), feature(fn_traits))]

src/liballoc/rc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,8 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Rc<T> {
843843
/// drop(foo); // Doesn't print anything
844844
/// drop(foo2); // Prints "dropped!"
845845
/// ```
846+
///
847+
/// [`Weak`]: ../../std/rc/struct.Weak.html
846848
fn drop(&mut self) {
847849
unsafe {
848850
self.dec_strong();
@@ -1422,9 +1424,10 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
14221424
#[stable(feature = "downgraded_weak", since = "1.10.0")]
14231425
impl<T> Default for Weak<T> {
14241426
/// Constructs a new `Weak<T>`, allocating memory for `T` without initializing
1425-
/// it. Calling [`upgrade`][Weak::upgrade] on the return value always gives [`None`].
1427+
/// it. Calling [`upgrade`] on the return value always gives [`None`].
14261428
///
14271429
/// [`None`]: ../../std/option/enum.Option.html
1430+
/// [`upgrade`]: ../../std/rc/struct.Weak.html#method.upgrade
14281431
///
14291432
/// # Examples
14301433
///

src/liballoc/sync.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,8 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Arc<T> {
955955
/// drop(foo); // Doesn't print anything
956956
/// drop(foo2); // Prints "dropped!"
957957
/// ```
958+
///
959+
/// [`Weak`]: ../../std/sync/struct.Weak.html
958960
#[inline]
959961
fn drop(&mut self) {
960962
// Because `fetch_sub` is already atomic, we do not need to synchronize
@@ -1222,10 +1224,11 @@ impl<T: ?Sized> Clone for Weak<T> {
12221224
#[stable(feature = "downgraded_weak", since = "1.10.0")]
12231225
impl<T> Default for Weak<T> {
12241226
/// Constructs a new `Weak<T>`, without allocating memory.
1225-
/// Calling [`upgrade`][Weak::upgrade] on the return value always
1227+
/// Calling [`upgrade`] on the return value always
12261228
/// gives [`None`].
12271229
///
12281230
/// [`None`]: ../../std/option/enum.Option.html#variant.None
1231+
/// [`upgrade`]: ../../std/sync/struct.Weak.html#method.upgrade
12291232
///
12301233
/// # Examples
12311234
///

src/libcore/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171

7272
#![no_core]
7373
#![deny(missing_docs)]
74+
#![deny(intra_doc_link_resolution_failure)]
7475
#![deny(missing_debug_implementations)]
7576

7677
#![feature(allow_internal_unstable)]

src/libcore/mem.rs

+3
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,9 @@ impl<T> ManuallyDrop<T> {
984984
///
985985
/// This function semantically moves out the contained value without preventing further usage.
986986
/// It is up to the user of this method to ensure that this container is not used again.
987+
///
988+
/// [`ManuallyDrop::drop`]: #method.drop
989+
/// [`ManuallyDrop::into_inner`]: #method.into_inner
987990
#[must_use = "if you don't need the value, you can use `ManuallyDrop::drop` instead"]
988991
#[unstable(feature = "manually_drop_take", issue = "55422")]
989992
#[inline]

src/libcore/slice/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ impl<T> [T] {
877877
/// assert_eq!(iter.remainder(), &['l']);
878878
/// ```
879879
///
880+
/// [`chunks`]: #method.chunks
880881
/// [`rchunks`]: #method.rchunks
881882
/// [`chunks_exact`]: #method.chunks_exact
882883
#[stable(feature = "rchunks", since = "1.31.0")]
@@ -921,6 +922,7 @@ impl<T> [T] {
921922
/// assert_eq!(v, &[0, 2, 2, 1, 1]);
922923
/// ```
923924
///
925+
/// [`chunks_mut`]: #method.chunks_mut
924926
/// [`rchunks_mut`]: #method.rchunks_mut
925927
/// [`chunks_exact_mut`]: #method.chunks_exact_mut
926928
#[stable(feature = "rchunks", since = "1.31.0")]

src/libstd/io/buffered.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl<R: Seek> Seek for BufReader<R> {
294294
/// `.into_inner()` immediately after a seek yields the underlying reader
295295
/// at the same position.
296296
///
297-
/// To seek without discarding the internal buffer, use [`Seek::seek_relative`].
297+
/// To seek without discarding the internal buffer, use [`BufReader::seek_relative`].
298298
///
299299
/// See [`std::io::Seek`] for more details.
300300
///
@@ -303,6 +303,9 @@ impl<R: Seek> Seek for BufReader<R> {
303303
/// seeks will be performed instead of one. If the second seek returns
304304
/// `Err`, the underlying reader will be left at the same position it would
305305
/// have if you called `seek` with `SeekFrom::Current(0)`.
306+
///
307+
/// [`BufReader::seek_relative`]: struct.BufReader.html#method.seek_relative
308+
/// [`std::io::Seek`]: trait.Seek.html
306309
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
307310
let result: u64;
308311
if let SeekFrom::Current(n) = pos {

src/libstd/io/error.rs

+3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ impl From<ErrorKind> for Error {
225225
/// let error = Error::from(not_found);
226226
/// assert_eq!("entity not found", format!("{}", error));
227227
/// ```
228+
///
229+
/// [`ErrorKind`]: ../../std/io/enum.ErrorKind.html
230+
/// [`Error`]: ../../std/io/struct.Error.html
228231
#[inline]
229232
fn from(kind: ErrorKind) -> Error {
230233
Error {

src/libstd/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
#![no_std]
223223

224224
#![deny(missing_docs)]
225+
#![deny(intra_doc_link_resolution_failure)]
225226
#![deny(missing_debug_implementations)]
226227

227228
// Tell the compiler to link to either panic_abort or panic_unwind

0 commit comments

Comments
 (0)