Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 751a9ad

Browse files
Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm
str: Stabilize `round_char_boundary` feature Closes #93743 FCP completed #93743 (comment)
2 parents ed9e767 + e42c1b1 commit 751a9ad

File tree

10 files changed

+22
-26
lines changed

10 files changed

+22
-26
lines changed

‎compiler/rustc_middle/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![allow(rustc::diagnostic_outside_of_impl)]
3030
#![allow(rustc::direct_use_of_rustc_type_ir)]
3131
#![allow(rustc::untranslatable_diagnostic)]
32+
#![cfg_attr(bootstrap, feature(round_char_boundary))]
3233
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3334
#![doc(rust_logo)]
3435
#![feature(allocator_api)]
@@ -51,7 +52,6 @@
5152
#![feature(negative_impls)]
5253
#![feature(never_type)]
5354
#![feature(ptr_alignment_type)]
54-
#![feature(round_char_boundary)]
5555
#![feature(rustc_attrs)]
5656
#![feature(rustdoc_internals)]
5757
#![feature(sized_hierarchy)]

‎compiler/rustc_span/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
// tidy-alphabetical-start
1919
#![allow(internal_features)]
20+
#![cfg_attr(bootstrap, feature(round_char_boundary))]
2021
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2122
#![doc(rust_logo)]
2223
#![feature(array_windows)]
@@ -26,7 +27,6 @@
2627
#![feature(map_try_insert)]
2728
#![feature(negative_impls)]
2829
#![feature(read_buf)]
29-
#![feature(round_char_boundary)]
3030
#![feature(rustc_attrs)]
3131
#![feature(rustdoc_internals)]
3232
// tidy-alphabetical-end

‎library/alloctests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![feature(inplace_iteration)]
2525
#![feature(iter_advance_by)]
2626
#![feature(iter_next_chunk)]
27-
#![feature(round_char_boundary)]
2827
#![feature(slice_partition_dedup)]
2928
#![feature(string_from_utf8_lossy_owned)]
3029
#![feature(string_remove_matches)]

‎library/core/src/str/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ impl str {
396396
/// # Examples
397397
///
398398
/// ```
399-
/// #![feature(round_char_boundary)]
400399
/// let s = "❤️🧡💛💚💙💜";
401400
/// assert_eq!(s.len(), 26);
402401
/// assert!(!s.is_char_boundary(13));
@@ -405,7 +404,8 @@ impl str {
405404
/// assert_eq!(closest, 10);
406405
/// assert_eq!(&s[..closest], "❤️🧡");
407406
/// ```
408-
#[unstable(feature = "round_char_boundary", issue = "93743")]
407+
#[stable(feature = "round_char_boundary", since = "CURRENT_RUSTC_VERSION")]
408+
#[rustc_const_stable(feature = "round_char_boundary", since = "CURRENT_RUSTC_VERSION")]
409409
#[inline]
410410
pub const fn floor_char_boundary(&self, index: usize) -> usize {
411411
if index >= self.len() {
@@ -439,7 +439,6 @@ impl str {
439439
/// # Examples
440440
///
441441
/// ```
442-
/// #![feature(round_char_boundary)]
443442
/// let s = "❤️🧡💛💚💙💜";
444443
/// assert_eq!(s.len(), 26);
445444
/// assert!(!s.is_char_boundary(13));
@@ -448,7 +447,8 @@ impl str {
448447
/// assert_eq!(closest, 14);
449448
/// assert_eq!(&s[..closest], "❤️🧡💛");
450449
/// ```
451-
#[unstable(feature = "round_char_boundary", issue = "93743")]
450+
#[stable(feature = "round_char_boundary", since = "CURRENT_RUSTC_VERSION")]
451+
#[rustc_const_stable(feature = "round_char_boundary", since = "CURRENT_RUSTC_VERSION")]
452452
#[inline]
453453
pub const fn ceil_char_boundary(&self, index: usize) -> usize {
454454
if index >= self.len() {

‎library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@
263263
all(target_vendor = "fortanix", target_env = "sgx"),
264264
feature(slice_index_methods, coerce_unsized, sgx_platform)
265265
)]
266-
#![cfg_attr(any(windows, target_os = "uefi"), feature(round_char_boundary))]
267266
#![cfg_attr(target_family = "wasm", feature(stdarch_wasm_atomic_wait))]
268267
#![cfg_attr(target_arch = "wasm64", feature(simd_wasm64))]
269268
//

‎src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// tidy-alphabetical-start
2+
#![cfg_attr(bootstrap, feature(round_char_boundary))]
23
#![doc(
34
html_root_url = "https://doc.rust-lang.org/nightly/",
45
html_playground_url = "https://play.rust-lang.org/"
@@ -13,7 +14,6 @@
1314
#![feature(if_let_guard)]
1415
#![feature(iter_advance_by)]
1516
#![feature(iter_intersperse)]
16-
#![feature(round_char_boundary)]
1717
#![feature(rustc_private)]
1818
#![feature(test)]
1919
#![warn(rustc::internal)]

‎src/tools/clippy/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)]

‎src/tools/clippy/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 {

‎src/tools/clippy/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 {

‎src/tools/clippy/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)

AltStyle によって変換されたページ (->オリジナル) /