about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/ascii.rs4
-rw-r--r--library/core/src/future/pending.rs4
-rw-r--r--library/core/src/future/poll_fn.rs4
-rw-r--r--library/core/src/future/ready.rs4
-rw-r--r--library/core/src/hint.rs2
-rw-r--r--library/core/src/option.rs2
-rw-r--r--library/core/src/slice/mod.rs2
-rw-r--r--library/core/src/str/mod.rs21
-rw-r--r--library/core/src/str/pattern.rs2
-rw-r--r--library/core/src/task/wake.rs29
10 files changed, 14 insertions, 60 deletions
diff --git a/library/core/src/ascii.rs b/library/core/src/ascii.rs
index e78dfd1ed4a..a8a25f92716 100644
--- a/library/core/src/ascii.rs
+++ b/library/core/src/ascii.rs
@@ -6,8 +6,6 @@
 //!
 //! The [`escape_default`] function provides an iterator over the bytes of an
 //! escaped version of the character given.
-//!
-//! [`escape_default`]: fn.escape_default.html
 
 #![stable(feature = "core_ascii", since = "1.26.0")]
 
@@ -20,8 +18,6 @@ use crate::str::from_utf8_unchecked;
 ///
 /// This `struct` is created by the [`escape_default`] function. See its
 /// documentation for more.
-///
-/// [`escape_default`]: fn.escape_default.html
 #[stable(feature = "rust1", since = "1.0.0")]
 #[derive(Clone)]
 pub struct EscapeDefault {
diff --git a/library/core/src/future/pending.rs b/library/core/src/future/pending.rs
index 4fec219ede2..ab162638a1c 100644
--- a/library/core/src/future/pending.rs
+++ b/library/core/src/future/pending.rs
@@ -7,10 +7,8 @@ use crate::task::{Context, Poll};
 /// Creates a future which never resolves, representing a computation that never
 /// finishes.
 ///
-/// This `struct` is created by the [`pending`] function. See its
+/// This `struct` is created by [`pending()`]. See its
 /// documentation for more.
-///
-/// [`pending`]: fn.pending.html
 #[stable(feature = "future_readiness_fns", since = "1.48.0")]
 #[must_use = "futures do nothing unless you `.await` or poll them"]
 pub struct Pending<T> {
diff --git a/library/core/src/future/poll_fn.rs b/library/core/src/future/poll_fn.rs
index 9ab3bfcea1c..f302cda09e7 100644
--- a/library/core/src/future/poll_fn.rs
+++ b/library/core/src/future/poll_fn.rs
@@ -33,10 +33,8 @@ where
 
 /// A Future that wraps a function returning `Poll`.
 ///
-/// This `struct` is created by the [`poll_fn`] function. See its
+/// This `struct` is created by [`poll_fn()`]. See its
 /// documentation for more.
-///
-/// [`poll_fn`]: fn.poll_fn.html
 #[must_use = "futures do nothing unless you `.await` or poll them"]
 #[unstable(feature = "future_poll_fn", issue = "72302")]
 pub struct PollFn<F> {
diff --git a/library/core/src/future/ready.rs b/library/core/src/future/ready.rs
index fcfd8779b0a..e98f5c570bf 100644
--- a/library/core/src/future/ready.rs
+++ b/library/core/src/future/ready.rs
@@ -4,10 +4,8 @@ use crate::task::{Context, Poll};
 
 /// Creates a future that is immediately ready with a value.
 ///
-/// This `struct` is created by the [`ready`] function. See its
+/// This `struct` is created by [`ready()`]. See its
 /// documentation for more.
-///
-/// [`ready`]: fn.ready.html
 #[stable(feature = "future_readiness_fns", since = "1.48.0")]
 #[derive(Debug, Clone)]
 #[must_use = "futures do nothing unless you `.await` or poll them"]
diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs
index e53682ece1d..4eb47dd1378 100644
--- a/library/core/src/hint.rs
+++ b/library/core/src/hint.rs
@@ -111,7 +111,7 @@ pub fn spin_loop() {
 #[cfg_attr(not(miri), inline)]
 #[cfg_attr(miri, inline(never))]
 #[unstable(feature = "test", issue = "50297")]
-#[allow(unreachable_code)] // this makes #[cfg] a bit easier below.
+#[cfg_attr(miri, allow(unused_mut))]
 pub fn black_box<T>(mut dummy: T) -> T {
     // We need to "use" the argument in some way LLVM can't introspect, and on
     // targets that support it we can typically leverage inline assembly to do
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index dd7556758be..7e560d63fe2 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -1502,8 +1502,6 @@ unsafe impl<A> TrustedLen for IterMut<'_, A> {}
 /// The iterator yields one value if the [`Option`] is a [`Some`], otherwise none.
 ///
 /// This `struct` is created by the [`Option::into_iter`] function.
-///
-/// [`Option::into_iter`]: enum.Option.html#method.into_iter
 #[derive(Clone, Debug)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct IntoIter<A> {
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index fd98f60c3dd..ff926c517bc 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -957,7 +957,7 @@ impl<T> [T] {
     ///
     /// This is the const generic equivalent of [`windows`].
     ///
-    /// If `N` is smaller than the size of the array, it will return no windows.
+    /// If `N` is greater than the size of the slice, it will return no windows.
     ///
     /// # Panics
     ///
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index ab9afeb25e0..6dc14f9125f 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -4,7 +4,7 @@
 //!
 //! For more details, see the [`std::str`] module.
 //!
-//! [`std::str`]: self
+//! [`std::str`]: ../../std/str/index.html
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
@@ -84,9 +84,6 @@ pub trait FromStr: Sized {
     /// when the string is ill-formatted return an error specific to the
     /// inside [`Err`]. The error type is specific to implementation of the trait.
     ///
-    /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
-    /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
-    ///
     /// # Examples
     ///
     /// Basic usage with [`i32`][ithirtytwo], a type that implements `FromStr`:
@@ -269,11 +266,9 @@ impl Utf8Error {
 ///
 /// If you are sure that the byte slice is valid UTF-8, and you don't want to
 /// incur the overhead of the validity check, there is an unsafe version of
-/// this function, [`from_utf8_unchecked`][fromutf8u], which has the same
+/// this function, [`from_utf8_unchecked`], which has the same
 /// behavior but skips the check.
 ///
-/// [fromutf8u]: fn.from_utf8_unchecked.html
-///
 /// If you need a `String` instead of a `&str`, consider
 /// [`String::from_utf8`][string].
 ///
@@ -318,11 +313,9 @@ impl Utf8Error {
 /// assert!(str::from_utf8(&sparkle_heart).is_err());
 /// ```
 ///
-/// See the docs for [`Utf8Error`][error] for more details on the kinds of
+/// See the docs for [`Utf8Error`] for more details on the kinds of
 /// errors that can be returned.
 ///
-/// [error]: struct.Utf8Error.html
-///
 /// A "stack allocated string":
 ///
 /// ```
@@ -371,10 +364,8 @@ pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
 ///
 /// assert!(str::from_utf8_mut(&mut invalid).is_err());
 /// ```
-/// See the docs for [`Utf8Error`][error] for more details on the kinds of
+/// See the docs for [`Utf8Error`] for more details on the kinds of
 /// errors that can be returned.
-///
-/// [error]: struct.Utf8Error.html
 #[stable(feature = "str_mut_extras", since = "1.20.0")]
 pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
     run_utf8_validation(v)?;
@@ -385,9 +376,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
 /// Converts a slice of bytes to a string slice without checking
 /// that the string contains valid UTF-8.
 ///
-/// See the safe version, [`from_utf8`][fromutf8], for more information.
-///
-/// [fromutf8]: fn.from_utf8.html
+/// See the safe version, [`from_utf8`], for more information.
 ///
 /// # Safety
 ///
diff --git a/library/core/src/str/pattern.rs b/library/core/src/str/pattern.rs
index 1cc2de5b875..508c522e71a 100644
--- a/library/core/src/str/pattern.rs
+++ b/library/core/src/str/pattern.rs
@@ -28,7 +28,7 @@
 //! assert_eq!(s.find(|c: char| c.is_ascii_punctuation()), Some(35));
 //! ```
 //!
-//! [pattern-impls]: trait.Pattern.html#implementors
+//! [pattern-impls]: Pattern#implementors
 
 #![unstable(
     feature = "pattern",
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs
index 92057209d8b..668a028a3f1 100644
--- a/library/core/src/task/wake.rs
+++ b/library/core/src/task/wake.rs
@@ -8,10 +8,8 @@ use crate::marker::{PhantomData, Unpin};
 ///
 /// [vtable]: https://en.wikipedia.org/wiki/Virtual_method_table
 ///
-/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
-/// customizes the behavior of the `RawWaker`.
-///
-/// [`Waker`]: struct.Waker.html
+/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable]
+/// that customizes the behavior of the `RawWaker`.
 #[derive(PartialEq, Debug)]
 #[stable(feature = "futures_api", since = "1.36.0")]
 pub struct RawWaker {
@@ -52,12 +50,10 @@ impl RawWaker {
 /// The pointer passed to all functions inside the vtable is the `data` pointer
 /// from the enclosing [`RawWaker`] object.
 ///
-/// The functions inside this struct are only intended be called on the `data`
+/// The functions inside this struct are only intended to be called on the `data`
 /// pointer of a properly constructed [`RawWaker`] object from inside the
 /// [`RawWaker`] implementation. Calling one of the contained functions using
 /// any other `data` pointer will cause undefined behavior.
-///
-/// [`RawWaker`]: struct.RawWaker.html
 #[stable(feature = "futures_api", since = "1.36.0")]
 #[derive(PartialEq, Copy, Clone, Debug)]
 pub struct RawWakerVTable {
@@ -68,9 +64,6 @@ pub struct RawWakerVTable {
     /// required for this additional instance of a [`RawWaker`] and associated
     /// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
     /// of the same task that would have been awoken by the original [`RawWaker`].
-    ///
-    /// [`Waker`]: struct.Waker.html
-    /// [`RawWaker`]: struct.RawWaker.html
     clone: unsafe fn(*const ()) -> RawWaker,
 
     /// This function will be called when `wake` is called on the [`Waker`].
@@ -79,9 +72,6 @@ pub struct RawWakerVTable {
     /// The implementation of this function must make sure to release any
     /// resources that are associated with this instance of a [`RawWaker`] and
     /// associated task.
-    ///
-    /// [`Waker`]: struct.Waker.html
-    /// [`RawWaker`]: struct.RawWaker.html
     wake: unsafe fn(*const ()),
 
     /// This function will be called when `wake_by_ref` is called on the [`Waker`].
@@ -89,9 +79,6 @@ pub struct RawWakerVTable {
     ///
     /// This function is similar to `wake`, but must not consume the provided data
     /// pointer.
-    ///
-    /// [`Waker`]: struct.Waker.html
-    /// [`RawWaker`]: struct.RawWaker.html
     wake_by_ref: unsafe fn(*const ()),
 
     /// This function gets called when a [`RawWaker`] gets dropped.
@@ -99,8 +86,6 @@ pub struct RawWakerVTable {
     /// The implementation of this function must make sure to release any
     /// resources that are associated with this instance of a [`RawWaker`] and
     /// associated task.
-    ///
-    /// [`RawWaker`]: struct.RawWaker.html
     drop: unsafe fn(*const ()),
 }
 
@@ -142,9 +127,6 @@ impl RawWakerVTable {
     /// The implementation of this function must make sure to release any
     /// resources that are associated with this instance of a [`RawWaker`] and
     /// associated task.
-    ///
-    /// [`Waker`]: struct.Waker.html
-    /// [`RawWaker`]: struct.RawWaker.html
     #[rustc_promotable]
     #[stable(feature = "futures_api", since = "1.36.0")]
     // `rustc_allow_const_fn_ptr` is a hack that should not be used anywhere else
@@ -208,8 +190,6 @@ impl fmt::Debug for Context<'_> {
 /// executor-specific wakeup behavior.
 ///
 /// Implements [`Clone`], [`Send`], and [`Sync`].
-///
-/// [`RawWaker`]: struct.RawWaker.html
 #[repr(transparent)]
 #[stable(feature = "futures_api", since = "1.36.0")]
 pub struct Waker {
@@ -275,9 +255,6 @@ impl Waker {
     /// The behavior of the returned `Waker` is undefined if the contract defined
     /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
     /// Therefore this method is unsafe.
-    ///
-    /// [`RawWaker`]: struct.RawWaker.html
-    /// [`RawWakerVTable`]: struct.RawWakerVTable.html
     #[inline]
     #[stable(feature = "futures_api", since = "1.36.0")]
     pub unsafe fn from_raw(waker: RawWaker) -> Waker {