Skip to content

Commit c94ed5c

Browse files
committed
Auto merge of rust-lang#75436 - JohnTitor:rollup-ss0lxds, r=JohnTitor
Rollup of 9 pull requests Successful merges: - rust-lang#74521 (older toolchains not valid anymore) - rust-lang#74960 (Fix regionck failure when converting Index to IndexMut) - rust-lang#75234 (Update asm! documentation in unstable book) - rust-lang#75368 (Move to doc links inside the prelude) - rust-lang#75371 (Move to doc links inside std/time.rs) - rust-lang#75394 (Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer) - rust-lang#75395 (Switch to intra-doc links in library/std/src/os/*/fs.rs) - rust-lang#75422 (Accept more safety comments) - rust-lang#75424 (fix wrong word in documentation) Failed merges: r? @ghost
2 parents 840dbe7 + 2cc7da6 commit c94ed5c

File tree

26 files changed

+155
-150
lines changed

26 files changed

+155
-150
lines changed

README.md

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<a href = "https://www.rust-lang.org/">
1+
<a href = "https://www.rust-lang.org/">
22
<img width = "90%" height = "auto" src = "https://img.shields.io/badge/Rust-Programming%20Language-black?style=flat&logo=rust" alt = "The Rust Programming Language">
33
</a>
44

55
This is the main source code repository for [Rust]. It contains the compiler,
6-
standard library, and documentation.
6+
standard library, and documentation.
77

88
[Rust]: https://www.rust-lang.org
99

@@ -23,7 +23,7 @@ Read ["Installation"] from [The Book].
2323
section.**
2424

2525
The Rust build system uses a Python script called `x.py` to build the compiler,
26-
which manages the bootstrapping process. More information about it can be found
26+
which manages the bootstrapping process. More information about it can be found
2727
by running `./x.py --help` or reading the [rustc dev guide][rustcguidebuild].
2828

2929
[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html
@@ -157,17 +157,6 @@ by manually calling the appropriate vcvars file before running the bootstrap.
157157
> python x.py build
158158
```
159159
160-
### Building rustc with older host toolchains
161-
It is still possible to build Rust with the older toolchain versions listed below, but only if the
162-
LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN option is set to true in the config.toml file.
163-
164-
* Clang 3.1
165-
* Apple Clang 3.1
166-
* GCC 4.8
167-
* Visual Studio 2015 (Update 3)
168-
169-
Toolchain versions older than what is listed above cannot be used to build rustc.
170-
171160
#### Specifying an ABI
172161
173162
Each specific ABI can also be used from either environment (for example, using

library/alloc/src/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
//! println!("{}, `{name:>8.*}` has 3 right-aligned characters", "Hello", 3, name="1234.56");
240240
//! ```
241241
//!
242-
//! print two significantly different things:
242+
//! print three significantly different things:
243243
//!
244244
//! ```text
245245
//! Hello, `1234.560` has 3 fractional digits

library/std/src/os/android/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::android::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/dragonfly/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::dragonfly::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/emscripten/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::emscripten::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/freebsd/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::freebsd::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/fuchsia/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::sys_common::AsInner;
55

66
/// OS-specific extensions to [`fs::Metadata`].
77
///
8-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
8+
/// [`fs::Metadata`]: crate::fs::Metadata
99
#[stable(feature = "metadata_ext", since = "1.1.0")]
1010
pub trait MetadataExt {
1111
#[stable(feature = "metadata_ext2", since = "1.8.0")]

library/std/src/os/haiku/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::haiku::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/illumos/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::illumos::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/ios/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::ios::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/linux/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::linux::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains
@@ -18,7 +18,7 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
///
21-
/// [`stat`]: ../../../../std/os/linux/raw/struct.stat.html
21+
/// [`stat`]: crate::os::linux::raw::stat
2222
///
2323
/// # Examples
2424
///

library/std/src/os/macos/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::macos::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/netbsd/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::netbsd::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/openbsd/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::openbsd::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/redox/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::redox::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains
@@ -18,7 +18,7 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
///
21-
/// [`stat`]: ../../../../std/os/redox/raw/struct.stat.html
21+
/// [`stat`]: crate::os::redox::raw::stat
2222
///
2323
/// # Examples
2424
///

library/std/src/os/solaris/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::os::solaris::raw;
88

99
/// OS-specific extensions to [`fs::Metadata`].
1010
///
11-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
11+
/// [`fs::Metadata`]: crate::fs::Metadata
1212
#[stable(feature = "metadata_ext", since = "1.1.0")]
1313
pub trait MetadataExt {
1414
/// Gain a reference to the underlying `stat` structure which contains

library/std/src/os/vxworks/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::fs::Metadata;
44
use crate::sys_common::AsInner;
55

66
///
7-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
7+
/// [`fs::Metadata`]: crate::fs::Metadata
88
#[stable(feature = "metadata_ext", since = "1.1.0")]
99
pub trait MetadataExt {
1010
#[stable(feature = "metadata_ext2", since = "1.8.0")]

library/std/src/prelude/mod.rs

+25-58
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! such as [`std::io::prelude`]. Various libraries in the Rust ecosystem may
1818
//! also define their own preludes.
1919
//!
20-
//! [`std::io::prelude`]: ../io/prelude/index.html
20+
//! [`std::io::prelude`]: crate::io::prelude
2121
//!
2222
//! The difference between 'the prelude' and these other preludes is that they
2323
//! are not automatically `use`'d, and must be imported manually. This is still
@@ -49,67 +49,34 @@
4949
//! * [`std::iter`]::{[`Iterator`], [`Extend`], [`IntoIterator`],
5050
//! [`DoubleEndedIterator`], [`ExactSizeIterator`]}. Iterators of various
5151
//! kinds.
52-
//! * [`std::option`]::[`Option`]::{`self`, `Some`, `None`}. A type which
53-
//! expresses the presence or absence of a value. This type is so commonly
54-
//! used, its variants are also exported.
55-
//! * [`std::result`]::[`Result`]::{`self`, `Ok`, `Err`}. A type for functions
56-
//! that may succeed or fail. Like [`Option`], its variants are exported as
57-
//! well.
52+
//! * [`std::option`]::[`Option`]::{[`self`][`Option`], [`Some`], [`None`]}. A
53+
//! type which expresses the presence or absence of a value. This type is so
54+
//! commonly used, its variants are also exported.
55+
//! * [`std::result`]::[`Result`]::{[`self`][`Result`], [`Ok`], [`Err`]}. A type
56+
//! for functions that may succeed or fail. Like [`Option`], its variants are
57+
//! exported as well.
5858
//! * [`std::string`]::{[`String`], [`ToString`]}, heap allocated strings.
59-
//! * [`std::vec`]::[`Vec`](../vec/struct.Vec.html), a growable, heap-allocated
59+
//! * [`std::vec`]::[`Vec`], a growable, heap-allocated
6060
//! vector.
6161
//!
62-
//! [`AsMut`]: ../convert/trait.AsMut.html
63-
//! [`AsRef`]: ../convert/trait.AsRef.html
64-
//! [`Box`]: ../boxed/struct.Box.html
65-
//! [`Clone`]: ../clone/trait.Clone.html
66-
//! [`Copy`]: ../marker/trait.Copy.html
67-
//! [`Default`]: ../default/trait.Default.html
68-
//! [`DoubleEndedIterator`]: ../iter/trait.DoubleEndedIterator.html
69-
//! [`Drop`]: ../ops/trait.Drop.html
70-
//! [`Eq`]: ../cmp/trait.Eq.html
71-
//! [`ExactSizeIterator`]: ../iter/trait.ExactSizeIterator.html
72-
//! [`Extend`]: ../iter/trait.Extend.html
73-
//! [`FnMut`]: ../ops/trait.FnMut.html
74-
//! [`FnOnce`]: ../ops/trait.FnOnce.html
75-
//! [`Fn`]: ../ops/trait.Fn.html
76-
//! [`From`]: ../convert/trait.From.html
77-
//! [`IntoIterator`]: ../iter/trait.IntoIterator.html
78-
//! [`Into`]: ../convert/trait.Into.html
79-
//! [`Iterator`]: ../iter/trait.Iterator.html
80-
//! [`Option`]: ../option/enum.Option.html
81-
//! [`Ord`]: ../cmp/trait.Ord.html
82-
//! [`PartialEq`]: ../cmp/trait.PartialEq.html
83-
//! [`PartialOrd`]: ../cmp/trait.PartialOrd.html
84-
//! [`Result`]: ../result/enum.Result.html
85-
//! [`Send`]: ../marker/trait.Send.html
86-
//! [`Sized`]: ../marker/trait.Sized.html
87-
//! [`SliceConcatExt`]: ../slice/trait.SliceConcatExt.html
88-
//! [`String`]: ../string/struct.String.html
89-
//! [`Sync`]: ../marker/trait.Sync.html
90-
//! [`ToOwned`]: ../borrow/trait.ToOwned.html
91-
//! [`ToString`]: ../string/trait.ToString.html
92-
//! [`Unpin`]: ../marker/trait.Unpin.html
93-
//! [`Vec`]: ../vec/struct.Vec.html
94-
//! [`Clone::clone`]: ../clone/trait.Clone.html#tymethod.clone
95-
//! [`mem::drop`]: ../mem/fn.drop.html
96-
//! [`std::borrow`]: ../borrow/index.html
97-
//! [`std::boxed`]: ../boxed/index.html
98-
//! [`std::clone`]: ../clone/index.html
99-
//! [`std::cmp`]: ../cmp/index.html
100-
//! [`std::convert`]: ../convert/index.html
101-
//! [`std::default`]: ../default/index.html
102-
//! [`std::iter`]: ../iter/index.html
103-
//! [`std::marker`]: ../marker/index.html
104-
//! [`std::mem`]: ../mem/index.html
105-
//! [`std::ops`]: ../ops/index.html
106-
//! [`std::option`]: ../option/index.html
107-
//! [`std::prelude::v1`]: v1/index.html
108-
//! [`std::result`]: ../result/index.html
109-
//! [`std::slice`]: ../slice/index.html
110-
//! [`std::string`]: ../string/index.html
62+
//! [`mem::drop`]: crate::mem::drop
63+
//! [`std::borrow`]: crate::borrow
64+
//! [`std::boxed`]: crate::boxed
65+
//! [`std::clone`]: crate::clone
66+
//! [`std::cmp`]: crate::cmp
67+
//! [`std::convert`]: crate::convert
68+
//! [`std::default`]: crate::default
69+
//! [`std::iter`]: crate::iter
70+
//! [`std::marker`]: crate::marker
71+
//! [`std::mem`]: crate::mem
72+
//! [`std::ops`]: crate::ops
73+
//! [`std::option`]: crate::option
74+
//! [`std::prelude::v1`]: v1
75+
//! [`std::result`]: crate::result
76+
//! [`std::slice`]: crate::slice
77+
//! [`std::string`]: crate::string
11178
//! [`std::vec`]: ../vec/index.html
112-
//! [`to_owned`]: ../borrow/trait.ToOwned.html#tymethod.to_owned
79+
//! [`to_owned`]: crate::borrow::ToOwned::to_owned
11380
//! [book-closures]: ../../book/ch13-01-closures.html
11481
//! [book-dtor]: ../../book/ch15-03-drop.html
11582
//! [book-enums]: ../../book/ch06-01-defining-an-enum.html

library/std/src/time.rs

+5-28
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub use core::time::Duration;
9797
/// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
9898
///
9999
/// **Disclaimer:** These system calls might change over time.
100-
///
101100
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
102101
#[stable(feature = "time2", since = "1.8.0")]
103102
pub struct Instant(time::Instant);
@@ -125,11 +124,6 @@ pub struct Instant(time::Instant);
125124
/// The size of a `SystemTime` struct may vary depending on the target operating
126125
/// system.
127126
///
128-
/// [`Instant`]: ../../std/time/struct.Instant.html
129-
/// [`Result`]: ../../std/result/enum.Result.html
130-
/// [`Duration`]: ../../std/time/struct.Duration.html
131-
/// [`UNIX_EPOCH`]: ../../std/time/constant.UNIX_EPOCH.html
132-
///
133127
/// Example:
134128
///
135129
/// ```no_run
@@ -176,7 +170,6 @@ pub struct Instant(time::Instant);
176170
/// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
177171
///
178172
/// **Disclaimer:** These system calls might change over time.
179-
///
180173
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
181174
#[stable(feature = "time2", since = "1.8.0")]
182175
pub struct SystemTime(time::SystemTime);
@@ -368,7 +361,7 @@ impl Add<Duration> for Instant {
368361
/// This function may panic if the resulting point in time cannot be represented by the
369362
/// underlying data structure. See [`checked_add`] for a version without panic.
370363
///
371-
/// [`checked_add`]: ../../std/time/struct.Instant.html#method.checked_add
364+
/// [`checked_add`]: Instant::checked_add
372365
fn add(self, other: Duration) -> Instant {
373366
self.checked_add(other).expect("overflow when adding duration to instant")
374367
}
@@ -463,11 +456,6 @@ impl SystemTime {
463456
/// Returns an [`Err`] if `earlier` is later than `self`, and the error
464457
/// contains how far from `self` the time is.
465458
///
466-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
467-
/// [`Duration`]: ../../std/time/struct.Duration.html
468-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
469-
/// [`Instant`]: ../../std/time/struct.Instant.html
470-
///
471459
/// # Examples
472460
///
473461
/// ```
@@ -497,11 +485,6 @@ impl SystemTime {
497485
/// Returns an [`Err`] if `self` is later than the current system time, and
498486
/// the error contains how far from the current system time `self` is.
499487
///
500-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
501-
/// [`Duration`]: ../../std/time/struct.Duration.html
502-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
503-
/// [`Instant`]: ../../std/time/struct.Instant.html
504-
///
505488
/// # Examples
506489
///
507490
/// ```no_run
@@ -544,7 +527,7 @@ impl Add<Duration> for SystemTime {
544527
/// This function may panic if the resulting point in time cannot be represented by the
545528
/// underlying data structure. See [`checked_add`] for a version without panic.
546529
///
547-
/// [`checked_add`]: ../../std/time/struct.SystemTime.html#method.checked_add
530+
/// [`checked_add`]: SystemTime::checked_add
548531
fn add(self, dur: Duration) -> SystemTime {
549532
self.checked_add(dur).expect("overflow when adding duration to instant")
550533
}
@@ -589,8 +572,6 @@ impl fmt::Debug for SystemTime {
589572
/// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
590573
/// [`SystemTime`] instance to represent another fixed point in time.
591574
///
592-
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
593-
///
594575
/// # Examples
595576
///
596577
/// ```no_run
@@ -608,13 +589,9 @@ impl SystemTimeError {
608589
/// Returns the positive duration which represents how far forward the
609590
/// second system time was from the first.
610591
///
611-
/// A `SystemTimeError` is returned from the [`duration_since`] and [`elapsed`]
612-
/// methods of [`SystemTime`] whenever the second system time represents a point later
613-
/// in time than the `self` of the method call.
614-
///
615-
/// [`duration_since`]: ../../std/time/struct.SystemTime.html#method.duration_since
616-
/// [`elapsed`]: ../../std/time/struct.SystemTime.html#method.elapsed
617-
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
592+
/// A `SystemTimeError` is returned from the [`SystemTime::duration_since`]
593+
/// and [`SystemTime::elapsed`] methods whenever the second system time
594+
/// represents a point later in time than the `self` of the method call.
618595
///
619596
/// # Examples
620597
///

0 commit comments

Comments
 (0)