Skip to content

Commit ef6ce65

Browse files
authored
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 10228bc + 82e55c1 commit ef6ce65

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
@@ -842,6 +842,8 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Rc<T> {
842842
/// drop(foo); // Doesn't print anything
843843
/// drop(foo2); // Prints "dropped!"
844844
/// ```
845+
///
846+
/// [`Weak`]: ../../std/rc/struct.Weak.html
845847
fn drop(&mut self) {
846848
unsafe {
847849
self.dec_strong();
@@ -1421,9 +1423,10 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
14211423
#[stable(feature = "downgraded_weak", since = "1.10.0")]
14221424
impl<T> Default for Weak<T> {
14231425
/// Constructs a new `Weak<T>`, allocating memory for `T` without initializing
1424-
/// it. Calling [`upgrade`][Weak::upgrade] on the return value always gives [`None`].
1426+
/// it. Calling [`upgrade`] on the return value always gives [`None`].
14251427
///
14261428
/// [`None`]: ../../std/option/enum.Option.html
1429+
/// [`upgrade`]: ../../std/rc/struct.Weak.html#method.upgrade
14271430
///
14281431
/// # Examples
14291432
///

src/liballoc/sync.rs

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

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)