diff options
| author | bors <bors@rust-lang.org> | 2020-08-21 09:00:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-21 09:00:49 +0000 |
| commit | 32cb8d40eb4382bd67510c0f06fc855063f0fde8 (patch) | |
| tree | 7de4de383051f02b3b79844ea1d531d67b739814 | |
| parent | b51651ae9d0161967617be930415705b2e4d5faf (diff) | |
| parent | 2a7f868d7fc99959912e611e16f4b78cc07c4f69 (diff) | |
| download | rust-32cb8d40eb4382bd67510c0f06fc855063f0fde8.tar.gz rust-32cb8d40eb4382bd67510c0f06fc855063f0fde8.zip | |
Auto merge of #75765 - JohnTitor:rollup-lexaoa9, r=JohnTitor
Rollup of 5 pull requests Successful merges: - #75324 (clarify documentation of remove_dir errors) - #75532 (Fix RFC-1014 test) - #75664 (Update mailmap for mati865) - #75727 (Switch to intra-doc links in `core::result`) - #75750 (Move to intra doc links for std::thread documentation) Failed merges: r? @ghost
| -rw-r--r-- | .mailmap | 4 | ||||
| -rw-r--r-- | library/core/src/result.rs | 85 | ||||
| -rw-r--r-- | library/std/src/fs.rs | 4 | ||||
| -rw-r--r-- | library/std/src/thread/local.rs | 8 | ||||
| -rw-r--r-- | library/std/src/thread/mod.rs | 119 | ||||
| -rw-r--r-- | src/test/ui/rfcs/rfc-1014-2.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/rfcs/rfc-1014.rs | 3 |
7 files changed, 65 insertions, 161 deletions
diff --git a/.mailmap b/.mailmap index 15ca403456a..cc7b2a677ba 100644 --- a/.mailmap +++ b/.mailmap @@ -176,8 +176,8 @@ Mark Sinclair <mark.edward.x@gmail.com> =Mark Sinclair <=125axel125@gmail.com> Markus Westerlind <marwes91@gmail.com> Markus <marwes91@gmail.com> Martin Hafskjold Thoresen <martinhath@gmail.com> Matej Lach <matej.lach@gmail.com> Matej Ľach <matej.lach@gmail.com> -Mateusz Mikuła <matti@marinelayer.io> <mati865@gmail.com> -Mateusz Mikuła <matti@marinelayer.io> <mati865@users.noreply.github.com> +Mateusz Mikuła <mati865@gmail.com> <mati865@users.noreply.github.com> +Mateusz Mikuła <mati865@gmail.com> <matti@marinelayer.io> Matt Brubeck <mbrubeck@limpet.net> <mbrubeck@cs.hmc.edu> Matthew Auld <matthew.auld@intel.com> Matthew Kraai <kraai@ftbfs.org> diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 5eddcb2172a..ade5472717d 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -216,17 +216,14 @@ //! [`?`] can only be used in functions that return [`Result`] because of the //! early return of [`Err`] that it provides. //! -//! [`expect`]: enum.Result.html#method.expect +//! [`expect`]: Result::expect //! [`Write`]: ../../std/io/trait.Write.html //! [`write_all`]: ../../std/io/trait.Write.html#method.write_all //! [`io::Result`]: ../../std/io/type.Result.html -//! [`?`]: ../../std/macro.try.html -//! [`Result`]: enum.Result.html -//! [`Ok(T)`]: enum.Result.html#variant.Ok -//! [`Err(E)`]: enum.Result.html#variant.Err +//! [`?`]: crate::ops::Try +//! [`Ok(T)`]: Ok +//! [`Err(E)`]: Err //! [`io::Error`]: ../../std/io/struct.Error.html -//! [`Ok`]: enum.Result.html#variant.Ok -//! [`Err`]: enum.Result.html#variant.Err #![stable(feature = "rust1", since = "1.0.0")] @@ -237,9 +234,6 @@ use crate::{convert, fmt}; /// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]). /// /// See the [`std::result`](index.html) module documentation for details. -/// -/// [`Ok`]: enum.Result.html#variant.Ok -/// [`Err`]: enum.Result.html#variant.Err #[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] #[must_use = "this `Result` may be an `Err` variant, which should be handled"] #[rustc_diagnostic_item = "result_type"] @@ -267,8 +261,6 @@ impl<T, E> Result<T, E> { /// Returns `true` if the result is [`Ok`]. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// /// # Examples /// /// Basic usage: @@ -290,8 +282,6 @@ impl<T, E> Result<T, E> { /// Returns `true` if the result is [`Err`]. /// - /// [`Err`]: enum.Result.html#variant.Err - /// /// # Examples /// /// Basic usage: @@ -378,7 +368,7 @@ impl<T, E> Result<T, E> { /// Converts `self` into an [`Option<T>`], consuming `self`, /// and discarding the error, if any. /// - /// [`Option<T>`]: ../../std/option/enum.Option.html + /// [`Option<T>`]: Option /// /// # Examples /// @@ -405,7 +395,7 @@ impl<T, E> Result<T, E> { /// Converts `self` into an [`Option<E>`], consuming `self`, /// and discarding the success value, if any. /// - /// [`Option<E>`]: ../../std/option/enum.Option.html + /// [`Option<E>`]: Option /// /// # Examples /// @@ -497,9 +487,6 @@ impl<T, E> Result<T, E> { /// /// This function can be used to compose the results of two functions. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err - /// /// # Examples /// /// Print the numbers on each line of a string multiplied by two. @@ -530,9 +517,7 @@ impl<T, E> Result<T, E> { /// the result of a function call, it is recommended to use [`map_or_else`], /// which is lazily evaluated. /// - /// [`map_or_else`]: #method.map_or_else - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err + /// [`map_or_else`]: Result::map_or_else /// /// # Examples /// @@ -559,8 +544,6 @@ impl<T, E> Result<T, E> { /// This function can be used to unpack a successful result /// while handling an error. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -590,8 +573,6 @@ impl<T, E> Result<T, E> { /// This function can be used to pass through a successful result while handling /// an error. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -671,8 +652,6 @@ impl<T, E> Result<T, E> { /// Returns `res` if the result is [`Ok`], otherwise returns the [`Err`] value of `self`. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -706,8 +685,6 @@ impl<T, E> Result<T, E> { /// Calls `op` if the result is [`Ok`], otherwise returns the [`Err`] value of `self`. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// This function can be used for control flow based on `Result` values. /// @@ -739,9 +716,7 @@ impl<T, E> Result<T, E> { /// result of a function call, it is recommended to use [`or_else`], which is /// lazily evaluated. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err - /// [`or_else`]: #method.or_else + /// [`or_else`]: Result::or_else /// /// # Examples /// @@ -777,8 +752,6 @@ impl<T, E> Result<T, E> { /// /// This function can be used for control flow based on result values. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -808,9 +781,7 @@ impl<T, E> Result<T, E> { /// the result of a function call, it is recommended to use [`unwrap_or_else`], /// which is lazily evaluated. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err - /// [`unwrap_or_else`]: #method.unwrap_or_else + /// [`unwrap_or_else`]: Result::unwrap_or_else /// /// # Examples /// @@ -835,7 +806,6 @@ impl<T, E> Result<T, E> { /// Returns the contained [`Ok`] value or computes it from a closure. /// - /// [`Ok`]: enum.Result.html#variant.Ok /// /// # Examples /// @@ -945,8 +915,6 @@ impl<T, E: fmt::Debug> Result<T, E> { /// Panics if the value is an [`Err`], with a panic message including the /// passed message, and the content of the [`Err`]. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -973,17 +941,15 @@ impl<T, E: fmt::Debug> Result<T, E> { /// case explicitly, or call [`unwrap_or`], [`unwrap_or_else`], or /// [`unwrap_or_default`]. /// - /// [`unwrap_or`]: #method.unwrap_or - /// [`unwrap_or_else`]: #method.unwrap_or_else - /// [`unwrap_or_default`]: #method.unwrap_or_default + /// [`unwrap_or`]: Result::unwrap_or + /// [`unwrap_or_else`]: Result::unwrap_or_else + /// [`unwrap_or_default`]: Result::unwrap_or_default /// /// # Panics /// /// Panics if the value is an [`Err`], with a panic message provided by the /// [`Err`]'s value. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -1017,8 +983,6 @@ impl<T: fmt::Debug, E> Result<T, E> { /// Panics if the value is an [`Ok`], with a panic message including the /// passed message, and the content of the [`Ok`]. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// # Examples /// @@ -1045,8 +1009,6 @@ impl<T: fmt::Debug, E> Result<T, E> { /// Panics if the value is an [`Ok`], with a custom panic message provided /// by the [`Ok`]'s value. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err /// /// /// # Examples @@ -1095,10 +1057,8 @@ impl<T: Default, E> Result<T, E> { /// assert_eq!(0, bad_year); /// ``` /// - /// [`parse`]: ../../std/primitive.str.html#method.parse - /// [`FromStr`]: ../../std/str/trait.FromStr.html - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err + /// [`parse`]: str::parse + /// [`FromStr`]: crate::str::FromStr #[inline] #[stable(feature = "result_unwrap_or_default", since = "1.16.0")] pub fn unwrap_or_default(self) -> T { @@ -1119,9 +1079,7 @@ impl<T, E: Into<!>> Result<T, E> { /// to compile if the error type of the `Result` is later changed /// to an error that can actually occur. /// - /// [`Ok`]: enum.Result.html#variant.Ok - /// [`Err`]: enum.Result.html#variant.Err - /// [`unwrap`]: enum.Result.html#method.unwrap + /// [`unwrap`]: Result::unwrap /// /// # Examples /// @@ -1343,10 +1301,6 @@ impl<'a, T, E> IntoIterator for &'a mut Result<T, E> { /// The iterator yields one value if the result is [`Ok`], otherwise none. /// /// Created by [`Result::iter`]. -/// -/// [`Ok`]: enum.Result.html#variant.Ok -/// [`Result`]: enum.Result.html -/// [`Result::iter`]: enum.Result.html#method.iter #[derive(Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Iter<'a, T: 'a> { @@ -1396,10 +1350,6 @@ impl<T> Clone for Iter<'_, T> { /// An iterator over a mutable reference to the [`Ok`] variant of a [`Result`]. /// /// Created by [`Result::iter_mut`]. -/// -/// [`Ok`]: enum.Result.html#variant.Ok -/// [`Result`]: enum.Result.html -/// [`Result::iter_mut`]: enum.Result.html#method.iter_mut #[derive(Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct IterMut<'a, T: 'a> { @@ -1445,10 +1395,7 @@ unsafe impl<A> TrustedLen for IterMut<'_, A> {} /// This struct is created by the [`into_iter`] method on /// [`Result`] (provided by the [`IntoIterator`] trait). /// -/// [`Ok`]: enum.Result.html#variant.Ok -/// [`Result`]: enum.Result.html -/// [`into_iter`]: ../iter/trait.IntoIterator.html#tymethod.into_iter -/// [`IntoIterator`]: ../iter/trait.IntoIterator.html +/// [`into_iter`]: IntoIterator::into_iter #[derive(Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct IntoIter<T> { diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 2767675ff92..b1630f8f549 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1921,7 +1921,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { DirBuilder::new().recursive(true).create(path.as_ref()) } -/// Removes an existing, empty directory. +/// Removes an empty directory. /// /// # Platform-specific behavior /// @@ -1936,6 +1936,8 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { /// This function will return an error in the following situations, but is not /// limited to just these cases: /// +/// * `path` doesn't exist. +/// * `path` isn't a directory. /// * The user lacks permissions to remove the directory at the provided `path`. /// * The directory isn't empty. /// diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 66508f06b28..a4562967f0b 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -71,9 +71,7 @@ use crate::fmt; /// not guard typically have a synthetic limit after which point no more /// destructors are run. /// -/// [`with`]: ../../std/thread/struct.LocalKey.html#method.with -/// [`thread_local!`]: ../../std/macro.thread_local.html -/// [`Drop`]: ../../std/ops/trait.Drop.html +/// [`with`]: LocalKey::with #[stable(feature = "rust1", since = "1.0.0")] pub struct LocalKey<T: 'static> { // This outer `LocalKey<T>` type is what's going to be stored in statics, @@ -118,10 +116,10 @@ impl<T: 'static> fmt::Debug for LocalKey<T> { /// # fn main() {} /// ``` /// -/// See [LocalKey documentation][`std::thread::LocalKey`] for more +/// See [`LocalKey` documentation][`std::thread::LocalKey`] for more /// information. /// -/// [`std::thread::LocalKey`]: ../std/thread/struct.LocalKey.html +/// [`std::thread::LocalKey`]: crate::thread::LocalKey #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] #[allow_internal_unstable(thread_local_internals)] diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 202867258f1..0b9849517c2 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -129,30 +129,19 @@ //! //! Note that the stack size of the main thread is *not* determined by Rust. //! -//! [channels]: ../../std/sync/mpsc/index.html -//! [`Arc`]: ../../std/sync/struct.Arc.html -//! [`spawn`]: ../../std/thread/fn.spawn.html -//! [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html -//! [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread -//! [`join`]: ../../std/thread/struct.JoinHandle.html#method.join -//! [`Result`]: ../../std/result/enum.Result.html -//! [`Ok`]: ../../std/result/enum.Result.html#variant.Ok -//! [`Err`]: ../../std/result/enum.Result.html#variant.Err -//! [`panic!`]: ../../std/macro.panic.html -//! [`Builder`]: ../../std/thread/struct.Builder.html -//! [`Builder::stack_size`]: ../../std/thread/struct.Builder.html#method.stack_size -//! [`Builder::name`]: ../../std/thread/struct.Builder.html#method.name -//! [`thread::current`]: ../../std/thread/fn.current.html -//! [`thread::Result`]: ../../std/thread/type.Result.html -//! [`Thread`]: ../../std/thread/struct.Thread.html -//! [`park`]: ../../std/thread/fn.park.html -//! [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark -//! [`Thread::name`]: ../../std/thread/struct.Thread.html#method.name -//! [`thread::park_timeout`]: ../../std/thread/fn.park_timeout.html -//! [`Cell`]: ../cell/struct.Cell.html -//! [`RefCell`]: ../cell/struct.RefCell.html -//! [`thread_local!`]: ../macro.thread_local.html -//! [`with`]: struct.LocalKey.html#method.with +//! [channels]: crate::sync::mpsc +//! [`join`]: JoinHandle::join +//! [`Result`]: crate::result::Result +//! [`Ok`]: crate::result::Result::Ok +//! [`Err`]: crate::result::Result::Err +//! [`thread::current`]: current +//! [`thread::Result`]: Result +//! [`unpark`]: Thread::unpark +//! [`Thread::name`]: Thread::name +//! [`thread::park_timeout`]: park_timeout +//! [`Cell`]: crate::cell::Cell +//! [`RefCell`]: crate::cell::RefCell +//! [`with`]: LocalKey::with #![stable(feature = "rust1", since = "1.0.0")] @@ -245,12 +234,12 @@ pub use self::local::statik::Key as __StaticLocalKeyInner; /// handler.join().unwrap(); /// ``` /// -/// [`thread::spawn`]: ../../std/thread/fn.spawn.html -/// [`stack_size`]: ../../std/thread/struct.Builder.html#method.stack_size -/// [`name`]: ../../std/thread/struct.Builder.html#method.name -/// [`spawn`]: ../../std/thread/struct.Builder.html#method.spawn -/// [`io::Result`]: ../../std/io/type.Result.html -/// [`unwrap`]: ../../std/result/enum.Result.html#method.unwrap +/// [`stack_size`]: Builder::stack_size +/// [`name`]: Builder::name +/// [`spawn`]: Builder::spawn +/// [`thread::spawn`]: spawn +/// [`io::Result`]: crate::io::Result +/// [`unwrap`]: crate::result::Result::unwrap /// [naming-threads]: ./index.html#naming-threads /// [stack-size]: ./index.html#stack-size #[stable(feature = "rust1", since = "1.0.0")] @@ -355,9 +344,7 @@ impl Builder { /// [`io::Result`] to capture any failure to create the thread at /// the OS level. /// - /// [`spawn`]: ../../std/thread/fn.spawn.html - /// [`io::Result`]: ../../std/io/type.Result.html - /// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html + /// [`io::Result`]: crate::io::Result /// /// # Panics /// @@ -443,11 +430,7 @@ impl Builder { /// handler.join().unwrap(); /// ``` /// - /// [`spawn`]: ../../std/thread/fn.spawn.html - /// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn - /// [`io::Result`]: ../../std/io/type.Result.html - /// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html - /// [`JoinHandle::join`]: ../../std/thread/struct.JoinHandle.html#method.join + /// [`io::Result`]: crate::io::Result #[unstable(feature = "thread_spawn_unchecked", issue = "55132")] pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>> where @@ -513,7 +496,7 @@ impl Builder { /// the main thread finishes). Additionally, the join handle provides a [`join`] /// method that can be used to join the child thread. If the child thread /// panics, [`join`] will return an [`Err`] containing the argument given to -/// [`panic`]. +/// [`panic!`]. /// /// This will create a thread using default parameters of [`Builder`], if you /// want to specify the stack size or the name of the thread, use this API @@ -600,15 +583,9 @@ impl Builder { /// println!("{}", result); /// ``` /// -/// [`channels`]: ../../std/sync/mpsc/index.html -/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html -/// [`join`]: ../../std/thread/struct.JoinHandle.html#method.join -/// [`Err`]: ../../std/result/enum.Result.html#variant.Err -/// [`panic`]: ../../std/macro.panic.html -/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn -/// [`Builder`]: ../../std/thread/struct.Builder.html -/// [`Send`]: ../../std/marker/trait.Send.html -/// [`Sync`]: ../../std/marker/trait.Sync.html +/// [`channels`]: crate::sync::mpsc +/// [`join`]: JoinHandle::join +/// [`Err`]: crate::result::Result::Err #[stable(feature = "rust1", since = "1.0.0")] pub fn spawn<F, T>(f: F) -> JoinHandle<T> where @@ -673,11 +650,8 @@ pub fn current() -> Thread { /// thread::yield_now(); /// ``` /// -/// [`channel`]: ../../std/sync/mpsc/index.html -/// [`spawn`]: ../../std/thread/fn.spawn.html -/// [`join`]: ../../std/thread/struct.JoinHandle.html#method.join -/// [`Mutex`]: ../../std/sync/struct.Mutex.html -/// [`Condvar`]: ../../std/sync/struct.Condvar.html +/// [`channel`]: crate::sync::mpsc +/// [`join`]: JoinHandle::join #[stable(feature = "rust1", since = "1.0.0")] pub fn yield_now() { imp::Thread::yield_now() @@ -723,8 +697,6 @@ pub fn yield_now() { /// panic!() /// } /// ``` -/// -/// [Mutex]: ../../std/sync/struct.Mutex.html #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn panicking() -> bool { @@ -881,10 +853,8 @@ const NOTIFIED: usize = 2; /// parked_thread.join().unwrap(); /// ``` /// -/// [`Thread`]: ../../std/thread/struct.Thread.html -/// [`park`]: ../../std/thread/fn.park.html -/// [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark -/// [`thread::park_timeout`]: ../../std/thread/fn.park_timeout.html +/// [`unpark`]: Thread::unpark +/// [`thread::park_timeout`]: park_timeout // // The implementation currently uses the trivial strategy of a Mutex+Condvar // with wakeup flag, which does not actually allow spurious wakeups. In the @@ -939,9 +909,6 @@ pub fn park() { /// amount of time waited to be precisely `ms` long. /// /// See the [park documentation][`park`] for more detail. -/// -/// [`park_timeout`]: fn.park_timeout.html -/// [`park`]: ../../std/thread/fn.park.html #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(since = "1.6.0", reason = "replaced by `std::thread::park_timeout`")] pub fn park_timeout_ms(ms: u32) { @@ -986,8 +953,6 @@ pub fn park_timeout_ms(ms: u32) { /// timeout_remaining = timeout - elapsed; /// } /// ``` -/// -/// [park]: fn.park.html #[stable(feature = "park_timeout", since = "1.4.0")] pub fn park_timeout(dur: Duration) { let thread = current(); @@ -1046,8 +1011,7 @@ pub fn park_timeout(dur: Duration) { /// assert!(thread::current().id() != other_thread_id); /// ``` /// -/// [`id`]: ../../std/thread/struct.Thread.html#method.id -/// [`Thread`]: ../../std/thread/struct.Thread.html +/// [`id`]: Thread::id #[stable(feature = "thread_id", since = "1.19.0")] #[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)] pub struct ThreadId(NonZeroU64); @@ -1124,12 +1088,7 @@ struct Inner { /// should instead use a function like `spawn` to create new threads, see the /// docs of [`Builder`] and [`spawn`] for more details. /// -/// [`Builder`]: ../../std/thread/struct.Builder.html -/// [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread -/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html -/// [`thread::current`]: ../../std/thread/fn.current.html -/// [`spawn`]: ../../std/thread/fn.spawn.html - +/// [`thread::current`]: current pub struct Thread { inner: Arc<Inner>, } @@ -1181,8 +1140,6 @@ impl Thread { /// /// parked_thread.join().unwrap(); /// ``` - /// - /// [park]: fn.park.html #[stable(feature = "rust1", since = "1.0.0")] pub fn unpark(&self) { // To ensure the unparked thread will observe any writes we made @@ -1326,7 +1283,7 @@ impl fmt::Debug for Thread { /// } /// ``` /// -/// [`Result`]: ../../std/result/enum.Result.html +/// [`Result`]: crate::result::Result #[stable(feature = "rust1", since = "1.0.0")] pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>; @@ -1421,9 +1378,8 @@ impl<T> JoinInner<T> { /// thread::sleep(Duration::from_millis(1000)); /// ``` /// -/// [`Clone`]: ../../std/clone/trait.Clone.html -/// [`thread::spawn`]: fn.spawn.html -/// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn +/// [`thread::Builder::spawn`]: Builder::spawn +/// [`thread::spawn`]: spawn #[stable(feature = "rust1", since = "1.0.0")] pub struct JoinHandle<T>(JoinInner<T>); @@ -1462,11 +1418,10 @@ impl<T> JoinHandle<T> { /// operations that happen after `join` returns. /// /// If the child thread panics, [`Err`] is returned with the parameter given - /// to [`panic`]. + /// to [`panic!`]. /// - /// [`Err`]: ../../std/result/enum.Result.html#variant.Err - /// [`panic`]: ../../std/macro.panic.html - /// [atomic memory orderings]: ../../std/sync/atomic/index.html + /// [`Err`]: crate::result::Result::Err + /// [atomic memory orderings]: crate::sync::atomic /// /// # Panics /// diff --git a/src/test/ui/rfcs/rfc-1014-2.rs b/src/test/ui/rfcs/rfc-1014-2.rs index 5be092204d7..7dd65701f12 100644 --- a/src/test/ui/rfcs/rfc-1014-2.rs +++ b/src/test/ui/rfcs/rfc-1014-2.rs @@ -23,7 +23,8 @@ fn close_stdout() { #[cfg(windows)] fn main() { close_stdout(); - println!("hello world"); + println!("hello"); + println!("world"); } #[cfg(not(windows))] diff --git a/src/test/ui/rfcs/rfc-1014.rs b/src/test/ui/rfcs/rfc-1014.rs index 41a036958bf..53b8fddcf31 100644 --- a/src/test/ui/rfcs/rfc-1014.rs +++ b/src/test/ui/rfcs/rfc-1014.rs @@ -30,5 +30,6 @@ fn close_stdout() { fn main() { close_stdout(); - println!("hello world"); + println!("hello"); + println!("world"); } |
