Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 32cb8d4

Browse files
committedAug 21, 2020
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
2 parents b51651a + 2a7f868 commit 32cb8d4

File tree

7 files changed

+65
-161
lines changed

7 files changed

+65
-161
lines changed
 

‎.mailmap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ Mark Sinclair <mark.edward.x@gmail.com> =Mark Sinclair <=125axel125@gmail.com>
176176
Markus Westerlind <marwes91@gmail.com> Markus <marwes91@gmail.com>
177177
Martin Hafskjold Thoresen <martinhath@gmail.com>
178178
Matej Lach <matej.lach@gmail.com> Matej Ľach <matej.lach@gmail.com>
179-
Mateusz Mikuła <matti@marinelayer.io> <mati865@gmail.com>
180-
Mateusz Mikuła <matti@marinelayer.io> <mati865@users.noreply.github.com>
179+
Mateusz Mikuła <mati865@gmail.com> <mati865@users.noreply.github.com>
180+
Mateusz Mikuła <mati865@gmail.com> <matti@marinelayer.io>
181181
Matt Brubeck <mbrubeck@limpet.net> <mbrubeck@cs.hmc.edu>
182182
Matthew Auld <matthew.auld@intel.com>
183183
Matthew Kraai <kraai@ftbfs.org>

‎library/core/src/result.rs

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,14 @@
216216
//! [`?`] can only be used in functions that return [`Result`] because of the
217217
//! early return of [`Err`] that it provides.
218218
//!
219-
//! [`expect`]: enum.Result.html#method.expect
219+
//! [`expect`]: Result::expect
220220
//! [`Write`]: ../../std/io/trait.Write.html
221221
//! [`write_all`]: ../../std/io/trait.Write.html#method.write_all
222222
//! [`io::Result`]: ../../std/io/type.Result.html
223-
//! [`?`]: ../../std/macro.try.html
224-
//! [`Result`]: enum.Result.html
225-
//! [`Ok(T)`]: enum.Result.html#variant.Ok
226-
//! [`Err(E)`]: enum.Result.html#variant.Err
223+
//! [`?`]: crate::ops::Try
224+
//! [`Ok(T)`]: Ok
225+
//! [`Err(E)`]: Err
227226
//! [`io::Error`]: ../../std/io/struct.Error.html
228-
//! [`Ok`]: enum.Result.html#variant.Ok
229-
//! [`Err`]: enum.Result.html#variant.Err
230227
231228
#![stable(feature = "rust1", since = "1.0.0")]
232229

@@ -237,9 +234,6 @@ use crate::{convert, fmt};
237234
/// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]).
238235
///
239236
/// See the [`std::result`](index.html) module documentation for details.
240-
///
241-
/// [`Ok`]: enum.Result.html#variant.Ok
242-
/// [`Err`]: enum.Result.html#variant.Err
243237
#[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
244238
#[must_use = "this `Result` may be an `Err` variant, which should be handled"]
245239
#[rustc_diagnostic_item = "result_type"]
@@ -267,8 +261,6 @@ impl<T, E> Result<T, E> {
267261

268262
/// Returns `true` if the result is [`Ok`].
269263
///
270-
/// [`Ok`]: enum.Result.html#variant.Ok
271-
///
272264
/// # Examples
273265
///
274266
/// Basic usage:
@@ -290,8 +282,6 @@ impl<T, E> Result<T, E> {
290282

291283
/// Returns `true` if the result is [`Err`].
292284
///
293-
/// [`Err`]: enum.Result.html#variant.Err
294-
///
295285
/// # Examples
296286
///
297287
/// Basic usage:
@@ -378,7 +368,7 @@ impl<T, E> Result<T, E> {
378368
/// Converts `self` into an [`Option<T>`], consuming `self`,
379369
/// and discarding the error, if any.
380370
///
381-
/// [`Option<T>`]: ../../std/option/enum.Option.html
371+
/// [`Option<T>`]: Option
382372
///
383373
/// # Examples
384374
///
@@ -405,7 +395,7 @@ impl<T, E> Result<T, E> {
405395
/// Converts `self` into an [`Option<E>`], consuming `self`,
406396
/// and discarding the success value, if any.
407397
///
408-
/// [`Option<E>`]: ../../std/option/enum.Option.html
398+
/// [`Option<E>`]: Option
409399
///
410400
/// # Examples
411401
///
@@ -497,9 +487,6 @@ impl<T, E> Result<T, E> {
497487
///
498488
/// This function can be used to compose the results of two functions.
499489
///
500-
/// [`Ok`]: enum.Result.html#variant.Ok
501-
/// [`Err`]: enum.Result.html#variant.Err
502-
///
503490
/// # Examples
504491
///
505492
/// Print the numbers on each line of a string multiplied by two.
@@ -530,9 +517,7 @@ impl<T, E> Result<T, E> {
530517
/// the result of a function call, it is recommended to use [`map_or_else`],
531518
/// which is lazily evaluated.
532519
///
533-
/// [`map_or_else`]: #method.map_or_else
534-
/// [`Ok`]: enum.Result.html#variant.Ok
535-
/// [`Err`]: enum.Result.html#variant.Err
520+
/// [`map_or_else`]: Result::map_or_else
536521
///
537522
/// # Examples
538523
///
@@ -559,8 +544,6 @@ impl<T, E> Result<T, E> {
559544
/// This function can be used to unpack a successful result
560545
/// while handling an error.
561546
///
562-
/// [`Ok`]: enum.Result.html#variant.Ok
563-
/// [`Err`]: enum.Result.html#variant.Err
564547
///
565548
/// # Examples
566549
///
@@ -590,8 +573,6 @@ impl<T, E> Result<T, E> {
590573
/// This function can be used to pass through a successful result while handling
591574
/// an error.
592575
///
593-
/// [`Ok`]: enum.Result.html#variant.Ok
594-
/// [`Err`]: enum.Result.html#variant.Err
595576
///
596577
/// # Examples
597578
///
@@ -671,8 +652,6 @@ impl<T, E> Result<T, E> {
671652

672653
/// Returns `res` if the result is [`Ok`], otherwise returns the [`Err`] value of `self`.
673654
///
674-
/// [`Ok`]: enum.Result.html#variant.Ok
675-
/// [`Err`]: enum.Result.html#variant.Err
676655
///
677656
/// # Examples
678657
///
@@ -706,8 +685,6 @@ impl<T, E> Result<T, E> {
706685

707686
/// Calls `op` if the result is [`Ok`], otherwise returns the [`Err`] value of `self`.
708687
///
709-
/// [`Ok`]: enum.Result.html#variant.Ok
710-
/// [`Err`]: enum.Result.html#variant.Err
711688
///
712689
/// This function can be used for control flow based on `Result` values.
713690
///
@@ -739,9 +716,7 @@ impl<T, E> Result<T, E> {
739716
/// result of a function call, it is recommended to use [`or_else`], which is
740717
/// lazily evaluated.
741718
///
742-
/// [`Ok`]: enum.Result.html#variant.Ok
743-
/// [`Err`]: enum.Result.html#variant.Err
744-
/// [`or_else`]: #method.or_else
719+
/// [`or_else`]: Result::or_else
745720
///
746721
/// # Examples
747722
///
@@ -777,8 +752,6 @@ impl<T, E> Result<T, E> {
777752
///
778753
/// This function can be used for control flow based on result values.
779754
///
780-
/// [`Ok`]: enum.Result.html#variant.Ok
781-
/// [`Err`]: enum.Result.html#variant.Err
782755
///
783756
/// # Examples
784757
///
@@ -808,9 +781,7 @@ impl<T, E> Result<T, E> {
808781
/// the result of a function call, it is recommended to use [`unwrap_or_else`],
809782
/// which is lazily evaluated.
810783
///
811-
/// [`Ok`]: enum.Result.html#variant.Ok
812-
/// [`Err`]: enum.Result.html#variant.Err
813-
/// [`unwrap_or_else`]: #method.unwrap_or_else
784+
/// [`unwrap_or_else`]: Result::unwrap_or_else
814785
///
815786
/// # Examples
816787
///
@@ -835,7 +806,6 @@ impl<T, E> Result<T, E> {
835806

836807
/// Returns the contained [`Ok`] value or computes it from a closure.
837808
///
838-
/// [`Ok`]: enum.Result.html#variant.Ok
839809
///
840810
/// # Examples
841811
///
@@ -945,8 +915,6 @@ impl<T, E: fmt::Debug> Result<T, E> {
945915
/// Panics if the value is an [`Err`], with a panic message including the
946916
/// passed message, and the content of the [`Err`].
947917
///
948-
/// [`Ok`]: enum.Result.html#variant.Ok
949-
/// [`Err`]: enum.Result.html#variant.Err
950918
///
951919
/// # Examples
952920
///
@@ -973,17 +941,15 @@ impl<T, E: fmt::Debug> Result<T, E> {
973941
/// case explicitly, or call [`unwrap_or`], [`unwrap_or_else`], or
974942
/// [`unwrap_or_default`].
975943
///
976-
/// [`unwrap_or`]: #method.unwrap_or
977-
/// [`unwrap_or_else`]: #method.unwrap_or_else
978-
/// [`unwrap_or_default`]: #method.unwrap_or_default
944+
/// [`unwrap_or`]: Result::unwrap_or
945+
/// [`unwrap_or_else`]: Result::unwrap_or_else
946+
/// [`unwrap_or_default`]: Result::unwrap_or_default
979947
///
980948
/// # Panics
981949
///
982950
/// Panics if the value is an [`Err`], with a panic message provided by the
983951
/// [`Err`]'s value.
984952
///
985-
/// [`Ok`]: enum.Result.html#variant.Ok
986-
/// [`Err`]: enum.Result.html#variant.Err
987953
///
988954
/// # Examples
989955
///
@@ -1017,8 +983,6 @@ impl<T: fmt::Debug, E> Result<T, E> {
1017983
/// Panics if the value is an [`Ok`], with a panic message including the
1018984
/// passed message, and the content of the [`Ok`].
1019985
///
1020-
/// [`Ok`]: enum.Result.html#variant.Ok
1021-
/// [`Err`]: enum.Result.html#variant.Err
1022986
///
1023987
/// # Examples
1024988
///
@@ -1045,8 +1009,6 @@ impl<T: fmt::Debug, E> Result<T, E> {
10451009
/// Panics if the value is an [`Ok`], with a custom panic message provided
10461010
/// by the [`Ok`]'s value.
10471011
///
1048-
/// [`Ok`]: enum.Result.html#variant.Ok
1049-
/// [`Err`]: enum.Result.html#variant.Err
10501012
///
10511013
///
10521014
/// # Examples
@@ -1095,10 +1057,8 @@ impl<T: Default, E> Result<T, E> {
10951057
/// assert_eq!(0, bad_year);
10961058
/// ```
10971059
///
1098-
/// [`parse`]: ../../std/primitive.str.html#method.parse
1099-
/// [`FromStr`]: ../../std/str/trait.FromStr.html
1100-
/// [`Ok`]: enum.Result.html#variant.Ok
1101-
/// [`Err`]: enum.Result.html#variant.Err
1060+
/// [`parse`]: str::parse
1061+
/// [`FromStr`]: crate::str::FromStr
11021062
#[inline]
11031063
#[stable(feature = "result_unwrap_or_default", since = "1.16.0")]
11041064
pub fn unwrap_or_default(self) -> T {
@@ -1119,9 +1079,7 @@ impl<T, E: Into<!>> Result<T, E> {
11191079
/// to compile if the error type of the `Result` is later changed
11201080
/// to an error that can actually occur.
11211081
///
1122-
/// [`Ok`]: enum.Result.html#variant.Ok
1123-
/// [`Err`]: enum.Result.html#variant.Err
1124-
/// [`unwrap`]: enum.Result.html#method.unwrap
1082+
/// [`unwrap`]: Result::unwrap
11251083
///
11261084
/// # Examples
11271085
///
@@ -1343,10 +1301,6 @@ impl<'a, T, E> IntoIterator for &'a mut Result<T, E> {
13431301
/// The iterator yields one value if the result is [`Ok`], otherwise none.
13441302
///
13451303
/// Created by [`Result::iter`].
1346-
///
1347-
/// [`Ok`]: enum.Result.html#variant.Ok
1348-
/// [`Result`]: enum.Result.html
1349-
/// [`Result::iter`]: enum.Result.html#method.iter
13501304
#[derive(Debug)]
13511305
#[stable(feature = "rust1", since = "1.0.0")]
13521306
pub struct Iter<'a, T: 'a> {
@@ -1396,10 +1350,6 @@ impl<T> Clone for Iter<'_, T> {
13961350
/// An iterator over a mutable reference to the [`Ok`] variant of a [`Result`].
13971351
///
13981352
/// Created by [`Result::iter_mut`].
1399-
///
1400-
/// [`Ok`]: enum.Result.html#variant.Ok
1401-
/// [`Result`]: enum.Result.html
1402-
/// [`Result::iter_mut`]: enum.Result.html#method.iter_mut
14031353
#[derive(Debug)]
14041354
#[stable(feature = "rust1", since = "1.0.0")]
14051355
pub struct IterMut<'a, T: 'a> {
@@ -1445,10 +1395,7 @@ unsafe impl<A> TrustedLen for IterMut<'_, A> {}
14451395
/// This struct is created by the [`into_iter`] method on
14461396
/// [`Result`] (provided by the [`IntoIterator`] trait).
14471397
///
1448-
/// [`Ok`]: enum.Result.html#variant.Ok
1449-
/// [`Result`]: enum.Result.html
1450-
/// [`into_iter`]: ../iter/trait.IntoIterator.html#tymethod.into_iter
1451-
/// [`IntoIterator`]: ../iter/trait.IntoIterator.html
1398+
/// [`into_iter`]: IntoIterator::into_iter
14521399
#[derive(Clone, Debug)]
14531400
#[stable(feature = "rust1", since = "1.0.0")]
14541401
pub struct IntoIter<T> {

‎library/std/src/fs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
19211921
DirBuilder::new().recursive(true).create(path.as_ref())
19221922
}
19231923

1924-
/// Removes an existing, empty directory.
1924+
/// Removes an empty directory.
19251925
///
19261926
/// # Platform-specific behavior
19271927
///
@@ -1936,6 +1936,8 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
19361936
/// This function will return an error in the following situations, but is not
19371937
/// limited to just these cases:
19381938
///
1939+
/// * `path` doesn't exist.
1940+
/// * `path` isn't a directory.
19391941
/// * The user lacks permissions to remove the directory at the provided `path`.
19401942
/// * The directory isn't empty.
19411943
///

‎library/std/src/thread/local.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ use crate::fmt;
7171
/// not guard typically have a synthetic limit after which point no more
7272
/// destructors are run.
7373
///
74-
/// [`with`]: ../../std/thread/struct.LocalKey.html#method.with
75-
/// [`thread_local!`]: ../../std/macro.thread_local.html
76-
/// [`Drop`]: ../../std/ops/trait.Drop.html
74+
/// [`with`]: LocalKey::with
7775
#[stable(feature = "rust1", since = "1.0.0")]
7876
pub struct LocalKey<T: 'static> {
7977
// 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> {
118116
/// # fn main() {}
119117
/// ```
120118
///
121-
/// See [LocalKey documentation][`std::thread::LocalKey`] for more
119+
/// See [`LocalKey` documentation][`std::thread::LocalKey`] for more
122120
/// information.
123121
///
124-
/// [`std::thread::LocalKey`]: ../std/thread/struct.LocalKey.html
122+
/// [`std::thread::LocalKey`]: crate::thread::LocalKey
125123
#[macro_export]
126124
#[stable(feature = "rust1", since = "1.0.0")]
127125
#[allow_internal_unstable(thread_local_internals)]

‎library/std/src/thread/mod.rs

Lines changed: 37 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -129,30 +129,19 @@
129129
//!
130130
//! Note that the stack size of the main thread is *not* determined by Rust.
131131
//!
132-
//! [channels]: ../../std/sync/mpsc/index.html
133-
//! [`Arc`]: ../../std/sync/struct.Arc.html
134-
//! [`spawn`]: ../../std/thread/fn.spawn.html
135-
//! [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
136-
//! [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread
137-
//! [`join`]: ../../std/thread/struct.JoinHandle.html#method.join
138-
//! [`Result`]: ../../std/result/enum.Result.html
139-
//! [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
140-
//! [`Err`]: ../../std/result/enum.Result.html#variant.Err
141-
//! [`panic!`]: ../../std/macro.panic.html
142-
//! [`Builder`]: ../../std/thread/struct.Builder.html
143-
//! [`Builder::stack_size`]: ../../std/thread/struct.Builder.html#method.stack_size
144-
//! [`Builder::name`]: ../../std/thread/struct.Builder.html#method.name
145-
//! [`thread::current`]: ../../std/thread/fn.current.html
146-
//! [`thread::Result`]: ../../std/thread/type.Result.html
147-
//! [`Thread`]: ../../std/thread/struct.Thread.html
148-
//! [`park`]: ../../std/thread/fn.park.html
149-
//! [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark
150-
//! [`Thread::name`]: ../../std/thread/struct.Thread.html#method.name
151-
//! [`thread::park_timeout`]: ../../std/thread/fn.park_timeout.html
152-
//! [`Cell`]: ../cell/struct.Cell.html
153-
//! [`RefCell`]: ../cell/struct.RefCell.html
154-
//! [`thread_local!`]: ../macro.thread_local.html
155-
//! [`with`]: struct.LocalKey.html#method.with
132+
//! [channels]: crate::sync::mpsc
133+
//! [`join`]: JoinHandle::join
134+
//! [`Result`]: crate::result::Result
135+
//! [`Ok`]: crate::result::Result::Ok
136+
//! [`Err`]: crate::result::Result::Err
137+
//! [`thread::current`]: current
138+
//! [`thread::Result`]: Result
139+
//! [`unpark`]: Thread::unpark
140+
//! [`Thread::name`]: Thread::name
141+
//! [`thread::park_timeout`]: park_timeout
142+
//! [`Cell`]: crate::cell::Cell
143+
//! [`RefCell`]: crate::cell::RefCell
144+
//! [`with`]: LocalKey::with
156145
157146
#![stable(feature = "rust1", since = "1.0.0")]
158147

@@ -245,12 +234,12 @@ pub use self::local::statik::Key as __StaticLocalKeyInner;
245234
/// handler.join().unwrap();
246235
/// ```
247236
///
248-
/// [`thread::spawn`]: ../../std/thread/fn.spawn.html
249-
/// [`stack_size`]: ../../std/thread/struct.Builder.html#method.stack_size
250-
/// [`name`]: ../../std/thread/struct.Builder.html#method.name
251-
/// [`spawn`]: ../../std/thread/struct.Builder.html#method.spawn
252-
/// [`io::Result`]: ../../std/io/type.Result.html
253-
/// [`unwrap`]: ../../std/result/enum.Result.html#method.unwrap
237+
/// [`stack_size`]: Builder::stack_size
238+
/// [`name`]: Builder::name
239+
/// [`spawn`]: Builder::spawn
240+
/// [`thread::spawn`]: spawn
241+
/// [`io::Result`]: crate::io::Result
242+
/// [`unwrap`]: crate::result::Result::unwrap
254243
/// [naming-threads]: ./index.html#naming-threads
255244
/// [stack-size]: ./index.html#stack-size
256245
#[stable(feature = "rust1", since = "1.0.0")]
@@ -355,9 +344,7 @@ impl Builder {
355344
/// [`io::Result`] to capture any failure to create the thread at
356345
/// the OS level.
357346
///
358-
/// [`spawn`]: ../../std/thread/fn.spawn.html
359-
/// [`io::Result`]: ../../std/io/type.Result.html
360-
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
347+
/// [`io::Result`]: crate::io::Result
361348
///
362349
/// # Panics
363350
///
@@ -443,11 +430,7 @@ impl Builder {
443430
/// handler.join().unwrap();
444431
/// ```
445432
///
446-
/// [`spawn`]: ../../std/thread/fn.spawn.html
447-
/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
448-
/// [`io::Result`]: ../../std/io/type.Result.html
449-
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
450-
/// [`JoinHandle::join`]: ../../std/thread/struct.JoinHandle.html#method.join
433+
/// [`io::Result`]: crate::io::Result
451434
#[unstable(feature = "thread_spawn_unchecked", issue = "55132")]
452435
pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>>
453436
where
@@ -513,7 +496,7 @@ impl Builder {
513496
/// the main thread finishes). Additionally, the join handle provides a [`join`]
514497
/// method that can be used to join the child thread. If the child thread
515498
/// panics, [`join`] will return an [`Err`] containing the argument given to
516-
/// [`panic`].
499+
/// [`panic!`].
517500
///
518501
/// This will create a thread using default parameters of [`Builder`], if you
519502
/// want to specify the stack size or the name of the thread, use this API
@@ -600,15 +583,9 @@ impl Builder {
600583
/// println!("{}", result);
601584
/// ```
602585
///
603-
/// [`channels`]: ../../std/sync/mpsc/index.html
604-
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
605-
/// [`join`]: ../../std/thread/struct.JoinHandle.html#method.join
606-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
607-
/// [`panic`]: ../../std/macro.panic.html
608-
/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
609-
/// [`Builder`]: ../../std/thread/struct.Builder.html
610-
/// [`Send`]: ../../std/marker/trait.Send.html
611-
/// [`Sync`]: ../../std/marker/trait.Sync.html
586+
/// [`channels`]: crate::sync::mpsc
587+
/// [`join`]: JoinHandle::join
588+
/// [`Err`]: crate::result::Result::Err
612589
#[stable(feature = "rust1", since = "1.0.0")]
613590
pub fn spawn<F, T>(f: F) -> JoinHandle<T>
614591
where
@@ -673,11 +650,8 @@ pub fn current() -> Thread {
673650
/// thread::yield_now();
674651
/// ```
675652
///
676-
/// [`channel`]: ../../std/sync/mpsc/index.html
677-
/// [`spawn`]: ../../std/thread/fn.spawn.html
678-
/// [`join`]: ../../std/thread/struct.JoinHandle.html#method.join
679-
/// [`Mutex`]: ../../std/sync/struct.Mutex.html
680-
/// [`Condvar`]: ../../std/sync/struct.Condvar.html
653+
/// [`channel`]: crate::sync::mpsc
654+
/// [`join`]: JoinHandle::join
681655
#[stable(feature = "rust1", since = "1.0.0")]
682656
pub fn yield_now() {
683657
imp::Thread::yield_now()
@@ -723,8 +697,6 @@ pub fn yield_now() {
723697
/// panic!()
724698
/// }
725699
/// ```
726-
///
727-
/// [Mutex]: ../../std/sync/struct.Mutex.html
728700
#[inline]
729701
#[stable(feature = "rust1", since = "1.0.0")]
730702
pub fn panicking() -> bool {
@@ -881,10 +853,8 @@ const NOTIFIED: usize = 2;
881853
/// parked_thread.join().unwrap();
882854
/// ```
883855
///
884-
/// [`Thread`]: ../../std/thread/struct.Thread.html
885-
/// [`park`]: ../../std/thread/fn.park.html
886-
/// [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark
887-
/// [`thread::park_timeout`]: ../../std/thread/fn.park_timeout.html
856+
/// [`unpark`]: Thread::unpark
857+
/// [`thread::park_timeout`]: park_timeout
888858
//
889859
// The implementation currently uses the trivial strategy of a Mutex+Condvar
890860
// with wakeup flag, which does not actually allow spurious wakeups. In the
@@ -939,9 +909,6 @@ pub fn park() {
939909
/// amount of time waited to be precisely `ms` long.
940910
///
941911
/// See the [park documentation][`park`] for more detail.
942-
///
943-
/// [`park_timeout`]: fn.park_timeout.html
944-
/// [`park`]: ../../std/thread/fn.park.html
945912
#[stable(feature = "rust1", since = "1.0.0")]
946913
#[rustc_deprecated(since = "1.6.0", reason = "replaced by `std::thread::park_timeout`")]
947914
pub fn park_timeout_ms(ms: u32) {
@@ -986,8 +953,6 @@ pub fn park_timeout_ms(ms: u32) {
986953
/// timeout_remaining = timeout - elapsed;
987954
/// }
988955
/// ```
989-
///
990-
/// [park]: fn.park.html
991956
#[stable(feature = "park_timeout", since = "1.4.0")]
992957
pub fn park_timeout(dur: Duration) {
993958
let thread = current();
@@ -1046,8 +1011,7 @@ pub fn park_timeout(dur: Duration) {
10461011
/// assert!(thread::current().id() != other_thread_id);
10471012
/// ```
10481013
///
1049-
/// [`id`]: ../../std/thread/struct.Thread.html#method.id
1050-
/// [`Thread`]: ../../std/thread/struct.Thread.html
1014+
/// [`id`]: Thread::id
10511015
#[stable(feature = "thread_id", since = "1.19.0")]
10521016
#[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)]
10531017
pub struct ThreadId(NonZeroU64);
@@ -1124,12 +1088,7 @@ struct Inner {
11241088
/// should instead use a function like `spawn` to create new threads, see the
11251089
/// docs of [`Builder`] and [`spawn`] for more details.
11261090
///
1127-
/// [`Builder`]: ../../std/thread/struct.Builder.html
1128-
/// [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread
1129-
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
1130-
/// [`thread::current`]: ../../std/thread/fn.current.html
1131-
/// [`spawn`]: ../../std/thread/fn.spawn.html
1132-
1091+
/// [`thread::current`]: current
11331092
pub struct Thread {
11341093
inner: Arc<Inner>,
11351094
}
@@ -1181,8 +1140,6 @@ impl Thread {
11811140
///
11821141
/// parked_thread.join().unwrap();
11831142
/// ```
1184-
///
1185-
/// [park]: fn.park.html
11861143
#[stable(feature = "rust1", since = "1.0.0")]
11871144
pub fn unpark(&self) {
11881145
// To ensure the unparked thread will observe any writes we made
@@ -1326,7 +1283,7 @@ impl fmt::Debug for Thread {
13261283
/// }
13271284
/// ```
13281285
///
1329-
/// [`Result`]: ../../std/result/enum.Result.html
1286+
/// [`Result`]: crate::result::Result
13301287
#[stable(feature = "rust1", since = "1.0.0")]
13311288
pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>;
13321289

@@ -1421,9 +1378,8 @@ impl<T> JoinInner<T> {
14211378
/// thread::sleep(Duration::from_millis(1000));
14221379
/// ```
14231380
///
1424-
/// [`Clone`]: ../../std/clone/trait.Clone.html
1425-
/// [`thread::spawn`]: fn.spawn.html
1426-
/// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn
1381+
/// [`thread::Builder::spawn`]: Builder::spawn
1382+
/// [`thread::spawn`]: spawn
14271383
#[stable(feature = "rust1", since = "1.0.0")]
14281384
pub struct JoinHandle<T>(JoinInner<T>);
14291385

@@ -1462,11 +1418,10 @@ impl<T> JoinHandle<T> {
14621418
/// operations that happen after `join` returns.
14631419
///
14641420
/// If the child thread panics, [`Err`] is returned with the parameter given
1465-
/// to [`panic`].
1421+
/// to [`panic!`].
14661422
///
1467-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
1468-
/// [`panic`]: ../../std/macro.panic.html
1469-
/// [atomic memory orderings]: ../../std/sync/atomic/index.html
1423+
/// [`Err`]: crate::result::Result::Err
1424+
/// [atomic memory orderings]: crate::sync::atomic
14701425
///
14711426
/// # Panics
14721427
///

‎src/test/ui/rfcs/rfc-1014-2.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ fn close_stdout() {
2323
#[cfg(windows)]
2424
fn main() {
2525
close_stdout();
26-
println!("hello world");
26+
println!("hello");
27+
println!("world");
2728
}
2829

2930
#[cfg(not(windows))]

‎src/test/ui/rfcs/rfc-1014.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ fn close_stdout() {
3030

3131
fn main() {
3232
close_stdout();
33-
println!("hello world");
33+
println!("hello");
34+
println!("world");
3435
}

0 commit comments

Comments
 (0)
Please sign in to comment.