diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-09-07 01:18:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-07 01:18:01 +0200 |
| commit | 8ff13f4fd268dbd3cd7dd6d0b9680114df03f70c (patch) | |
| tree | a73b8385cc738aaea4a93bb9abfd4d6b37f367ef | |
| parent | 52d9162645b031e2cb9ed7ec239992017be99356 (diff) | |
| parent | dfd219d6e77311a19a630461b08f6fb3e06b0dd2 (diff) | |
| download | rust-8ff13f4fd268dbd3cd7dd6d0b9680114df03f70c.tar.gz rust-8ff13f4fd268dbd3cd7dd6d0b9680114df03f70c.zip | |
Rollup merge of #76309 - lzutao:indent-note, r=jyn514
Indent a note to make folding work nicer Sublime Text folds code based on indentation. It maybe an unnecessary change, but does it look nicer after that ?
| -rw-r--r-- | library/core/src/slice/mod.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/str/str-idx.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/str/str-mut-idx.stderr | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 16170ecbc27..aa9ad395b18 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -3357,8 +3357,9 @@ mod private_slice_index { on(T = "str", label = "string indices are ranges of `usize`",), on( all(any(T = "str", T = "&str", T = "std::string::String"), _Self = "{integer}"), - note = "you can use `.chars().nth()` or `.bytes().nth()` -see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>" + note = "you can use `.chars().nth()` or `.bytes().nth()`\n\ + for more information, see chapter 8 in The Book: \ + <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>" ), message = "the type `{T}` cannot be indexed by `{Self}`", label = "slice indices are of type `usize` or ranges of `usize`" diff --git a/src/test/ui/str/str-idx.stderr b/src/test/ui/str/str-idx.stderr index ef7ce735868..f323ba03c01 100644 --- a/src/test/ui/str/str-idx.stderr +++ b/src/test/ui/str/str-idx.stderr @@ -6,7 +6,7 @@ LL | let _: u8 = s[4]; | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` - see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> + for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> = note: required because of the requirements on the impl of `Index<{integer}>` for `str` error[E0277]: the type `str` cannot be indexed by `{integer}` @@ -17,7 +17,7 @@ LL | let _ = s.get(4); | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` - see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> + for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-idx.rs:5:29 @@ -27,7 +27,7 @@ LL | let _ = s.get_unchecked(4); | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` - see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> + for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-idx.rs:6:17 diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index abb9b09cf38..405542820a3 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -39,7 +39,7 @@ LL | s.get_mut(1); | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` - see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> + for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-mut-idx.rs:11:25 @@ -49,7 +49,7 @@ LL | s.get_unchecked_mut(1); | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` - see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> + for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-mut-idx.rs:13:5 |
