Skip to content

Commit 951e64f

Browse files
authored
Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm
str: Stabilize `round_char_boundary` feature Closes rust-lang/rust#93743 FCP completed rust-lang/rust#93743 (comment)
2 parents 79f3ae4 + 9e3360f commit 951e64f

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![feature(iter_intersperse)]
88
#![feature(iter_partition_in_place)]
99
#![feature(never_type)]
10-
#![feature(round_char_boundary)]
10+
#![cfg_attr(bootstrap, feature(round_char_boundary))]
1111
#![feature(rustc_private)]
1212
#![feature(stmt_expr_attributes)]
1313
#![feature(unwrap_infallible)]

tests/ui/char_indices_as_byte_indices.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(round_char_boundary)]
21
#![warn(clippy::char_indices_as_byte_indices)]
32

43
trait StrExt {

tests/ui/char_indices_as_byte_indices.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(round_char_boundary)]
21
#![warn(clippy::char_indices_as_byte_indices)]
32

43
trait StrExt {

tests/ui/char_indices_as_byte_indices.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: indexing into a string with a character position where a byte index is expected
2-
--> tests/ui/char_indices_as_byte_indices.rs:13:24
2+
--> tests/ui/char_indices_as_byte_indices.rs:12:24
33
|
44
LL | let _ = prim[..idx];
55
| ^^^
66
|
77
= note: a character can take up more than one byte, so they are not interchangeable
88
note: position comes from the enumerate iterator
9-
--> tests/ui/char_indices_as_byte_indices.rs:12:10
9+
--> tests/ui/char_indices_as_byte_indices.rs:11:10
1010
|
1111
LL | for (idx, _) in prim.chars().enumerate() {
1212
| ^^^ ^^^^^^^^^^^
@@ -19,14 +19,14 @@ LL + for (idx, _) in prim.char_indices() {
1919
|
2020

2121
error: passing a character position to a method that expects a byte index
22-
--> tests/ui/char_indices_as_byte_indices.rs:15:23
22+
--> tests/ui/char_indices_as_byte_indices.rs:14:23
2323
|
2424
LL | prim.split_at(idx);
2525
| ^^^
2626
|
2727
= note: a character can take up more than one byte, so they are not interchangeable
2828
note: position comes from the enumerate iterator
29-
--> tests/ui/char_indices_as_byte_indices.rs:12:10
29+
--> tests/ui/char_indices_as_byte_indices.rs:11:10
3030
|
3131
LL | for (idx, _) in prim.chars().enumerate() {
3232
| ^^^ ^^^^^^^^^^^
@@ -37,14 +37,14 @@ LL + for (idx, _) in prim.char_indices() {
3737
|
3838

3939
error: passing a character position to a method that expects a byte index
40-
--> tests/ui/char_indices_as_byte_indices.rs:19:49
40+
--> tests/ui/char_indices_as_byte_indices.rs:18:49
4141
|
4242
LL | let _ = prim[..prim.floor_char_boundary(idx)];
4343
| ^^^
4444
|
4545
= note: a character can take up more than one byte, so they are not interchangeable
4646
note: position comes from the enumerate iterator
47-
--> tests/ui/char_indices_as_byte_indices.rs:12:10
47+
--> tests/ui/char_indices_as_byte_indices.rs:11:10
4848
|
4949
LL | for (idx, _) in prim.chars().enumerate() {
5050
| ^^^ ^^^^^^^^^^^
@@ -55,14 +55,14 @@ LL + for (idx, _) in prim.char_indices() {
5555
|
5656

5757
error: indexing into a string with a character position where a byte index is expected
58-
--> tests/ui/char_indices_as_byte_indices.rs:29:24
58+
--> tests/ui/char_indices_as_byte_indices.rs:28:24
5959
|
6060
LL | let _ = prim[..c.0];
6161
| ^^^
6262
|
6363
= note: a character can take up more than one byte, so they are not interchangeable
6464
note: position comes from the enumerate iterator
65-
--> tests/ui/char_indices_as_byte_indices.rs:28:9
65+
--> tests/ui/char_indices_as_byte_indices.rs:27:9
6666
|
6767
LL | for c in prim.chars().enumerate() {
6868
| ^ ^^^^^^^^^^^
@@ -73,14 +73,14 @@ LL + for c in prim.char_indices() {
7373
|
7474

7575
error: passing a character position to a method that expects a byte index
76-
--> tests/ui/char_indices_as_byte_indices.rs:31:23
76+
--> tests/ui/char_indices_as_byte_indices.rs:30:23
7777
|
7878
LL | prim.split_at(c.0);
7979
| ^^^
8080
|
8181
= note: a character can take up more than one byte, so they are not interchangeable
8282
note: position comes from the enumerate iterator
83-
--> tests/ui/char_indices_as_byte_indices.rs:28:9
83+
--> tests/ui/char_indices_as_byte_indices.rs:27:9
8484
|
8585
LL | for c in prim.chars().enumerate() {
8686
| ^ ^^^^^^^^^^^
@@ -91,14 +91,14 @@ LL + for c in prim.char_indices() {
9191
|
9292

9393
error: indexing into a string with a character position where a byte index is expected
94-
--> tests/ui/char_indices_as_byte_indices.rs:36:26
94+
--> tests/ui/char_indices_as_byte_indices.rs:35:26
9595
|
9696
LL | let _ = string[..idx];
9797
| ^^^
9898
|
9999
= note: a character can take up more than one byte, so they are not interchangeable
100100
note: position comes from the enumerate iterator
101-
--> tests/ui/char_indices_as_byte_indices.rs:35:10
101+
--> tests/ui/char_indices_as_byte_indices.rs:34:10
102102
|
103103
LL | for (idx, _) in string.chars().enumerate() {
104104
| ^^^ ^^^^^^^^^^^
@@ -109,14 +109,14 @@ LL + for (idx, _) in string.char_indices() {
109109
|
110110

111111
error: passing a character position to a method that expects a byte index
112-
--> tests/ui/char_indices_as_byte_indices.rs:38:25
112+
--> tests/ui/char_indices_as_byte_indices.rs:37:25
113113
|
114114
LL | string.split_at(idx);
115115
| ^^^
116116
|
117117
= note: a character can take up more than one byte, so they are not interchangeable
118118
note: position comes from the enumerate iterator
119-
--> tests/ui/char_indices_as_byte_indices.rs:35:10
119+
--> tests/ui/char_indices_as_byte_indices.rs:34:10
120120
|
121121
LL | for (idx, _) in string.chars().enumerate() {
122122
| ^^^ ^^^^^^^^^^^

0 commit comments

Comments
 (0)