Skip to content

Commit d9a328a

Browse files
committed
Auto merge of #69424 - pietroalbini:rollup-3oelogm, r=pietroalbini
Rollup of 5 pull requests Successful merges: - #69372 (Updates links in various Compiler Error Index entries) - #69385 (Relax str::get_unchecked precondition to permit empty slicing) - #69386 (Fix minor error in `MaybeUninit::get_mut()` doc example) - #69394 (Clean up E0367 explanation) - #69405 (docs: Stdin::read_line: mention the appending) Failed merges: r? @ghost
2 parents 79cd224 + ba3fee6 commit d9a328a

33 files changed

+122
-79
lines changed

src/libcore/mem/maybe_uninit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl<T> MaybeUninit<T> {
669669
/// // Now we can use `buf` as a normal slice:
670670
/// buf.sort_unstable();
671671
/// assert!(
672-
/// buf.chunks(2).all(|chunk| chunk[0] <= chunk[1]),
672+
/// buf.windows(2).all(|pair| pair[0] <= pair[1]),
673673
/// "buffer is sorted",
674674
/// );
675675
/// ```

src/libcore/str/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,7 @@ impl str {
24862486
/// Callers of this function are responsible that these preconditions are
24872487
/// satisfied:
24882488
///
2489-
/// * The starting index must come before the ending index;
2489+
/// * The starting index must not exceed the ending index;
24902490
/// * Indexes must be within bounds of the original slice;
24912491
/// * Indexes must lie on UTF-8 sequence boundaries.
24922492
///
@@ -2518,7 +2518,7 @@ impl str {
25182518
/// Callers of this function are responsible that these preconditions are
25192519
/// satisfied:
25202520
///
2521-
/// * The starting index must come before the ending index;
2521+
/// * The starting index must not exceed the ending index;
25222522
/// * Indexes must be within bounds of the original slice;
25232523
/// * Indexes must lie on UTF-8 sequence boundaries.
25242524
///
@@ -2563,7 +2563,7 @@ impl str {
25632563
/// Callers of this function are responsible that three preconditions are
25642564
/// satisfied:
25652565
///
2566-
/// * `begin` must come before `end`.
2566+
/// * `begin` must not exceed `end`.
25672567
/// * `begin` and `end` must be byte positions within the string slice.
25682568
/// * `begin` and `end` must lie on UTF-8 sequence boundaries.
25692569
///
@@ -2612,7 +2612,7 @@ impl str {
26122612
/// Callers of this function are responsible that three preconditions are
26132613
/// satisfied:
26142614
///
2615-
/// * `begin` must come before `end`.
2615+
/// * `begin` must not exceed `end`.
26162616
/// * `begin` and `end` must be byte positions within the string slice.
26172617
/// * `begin` and `end` must lie on UTF-8 sequence boundaries.
26182618
#[stable(feature = "str_slice_mut", since = "1.5.0")]

src/librustc_error_codes/error_codes/E0080.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ constant expression that had to be evaluated. Attempting to divide by 0
1414
or causing an integer overflow are two ways to induce this error.
1515

1616
Ensure that the expressions given can be evaluated as the desired integer type.
17-
See the FFI section of the Reference for more information about using a custom
18-
integer type:
1917

20-
https://doc.rust-lang.org/reference.html#ffi-attributes
18+
See the [Custom Discriminants][custom-discriminants] section of the Reference
19+
for more information about setting custom integer types on fieldless enums
20+
using the [`repr` attribute][repr-attribute].
21+
22+
[custom-discriminants]: https://doc.rust-lang.org/reference/items/enumerations.html#custom-discriminant-values-for-field-less-enumerations
23+
[repr-attribute]: https://doc.rust-lang.org/reference/type-layout.html#reprc-enums

src/librustc_error_codes/error_codes/E0133.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ fn main() {
2828
}
2929
```
3030

31-
See also https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
31+
See the [unsafe section][unsafe-section] of the Book for more details.
32+
33+
[unsafe-section]: https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html

src/librustc_error_codes/error_codes/E0154.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ fn f() {
2727
}
2828
```
2929

30-
See the Declaration Statements section of the reference for more information
31-
about what constitutes an Item declaration and what does not:
30+
See the [Declaration Statements][declaration-statements] section of the
31+
reference for more information about what constitutes an item declaration
32+
and what does not.
3233

33-
https://doc.rust-lang.org/reference.html#statements
34+
[declaration-statements]: https://doc.rust-lang.org/reference/statements.html#declaration-statements

src/librustc_error_codes/error_codes/E0260.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ extern crate core as xyz;
2828
struct abc;
2929
```
3030

31-
See the Declaration Statements section of the reference for more information
32-
about what constitutes an Item declaration and what does not:
31+
See the [Declaration Statements][declaration-statements] section of the
32+
reference for more information about what constitutes an item declaration
33+
and what does not.
3334

34-
https://doc.rust-lang.org/reference.html#statements
35+
[declaration-statements]: https://doc.rust-lang.org/reference/statements.html#declaration-statements

src/librustc_error_codes/error_codes/E0303.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ match Some("hi".to_string()) {
3333

3434
The `op_string_ref` binding has type `&Option<&String>` in both cases.
3535

36-
See also https://github.com/rust-lang/rust/issues/14587
36+
See also [Issue 14587][issue-14587].
37+
38+
[issue-14587]: https://github.com/rust-lang/rust/issues/14587

src/librustc_error_codes/error_codes/E0364.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub use foo::X;
2626
fn main() {}
2727
```
2828

29-
See the 'Use Declarations' section of the reference for more information on
30-
this topic:
29+
See the [Use Declarations][use-declarations] section of the reference for
30+
more information on this topic.
3131

32-
https://doc.rust-lang.org/reference.html#use-declarations
32+
[use-declarations]: https://doc.rust-lang.org/reference/items/use-declarations.html

src/librustc_error_codes/error_codes/E0365.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub use foo as foo2;
2626
fn main() {}
2727
```
2828

29-
See the 'Use Declarations' section of the reference for more information
30-
on this topic:
29+
See the [Use Declarations][use-declarations] section of the reference for
30+
more information on this topic.
3131

32-
https://doc.rust-lang.org/reference.html#use-declarations
32+
[use-declarations]: https://doc.rust-lang.org/reference/items/use-declarations.html

src/librustc_error_codes/error_codes/E0367.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
An attempt was made to implement `Drop` on a specialization of a generic type.
2-
An example is shown below:
2+
3+
Erroneous code example:
34

45
```compile_fail,E0367
5-
trait Foo{}
6+
trait Foo {}
67
78
struct MyStruct<T> {
89
t: T

0 commit comments

Comments
 (0)