Skip to content

Commit 8db1594

Browse files
committed
Fix no_oom_handling
1 parent e0c3c99 commit 8db1594

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

library/alloc/src/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3609,8 +3609,8 @@ impl From<char> for String {
36093609

36103610
// In place case changes
36113611

3612+
#[cfg(not(no_global_oom_handling))]
36123613
impl String {
3613-
#[cfg(not(no_global_oom_handling))]
36143614
fn case_change_while_ascii<const MAKE_UPPER: bool>(&mut self) -> ControlFlow<usize> {
36153615
// SAFETY the as_bytes_mut is unsafe but we will only do ascii case change in place with it
36163616
unsafe {
@@ -3672,7 +3672,6 @@ impl String {
36723672
///
36733673
/// assert_eq!("TSCHÜSS", s);
36743674
/// ```
3675-
#[cfg(not(no_global_oom_handling))]
36763675
#[unstable(feature = "string_make_uplowercase", issue = "135885")]
36773676
pub fn make_uppercase(&mut self) {
36783677
let ControlFlow::Break(non_utf8_offset) = self.case_change_while_ascii::<true>() else {
@@ -3729,7 +3728,6 @@ impl String {
37293728
///
37303729
/// assert_eq!("农历新年", new_year);
37313730
/// ```
3732-
#[cfg(not(no_global_oom_handling))]
37333731
#[unstable(feature = "string_make_uplowercase", issue = "135885")]
37343732
pub fn make_lowercase(&mut self) {
37353733
fn update_word_final(word_final_so_far: bool, u_c: char) -> bool {
@@ -3769,6 +3767,7 @@ impl String {
37693767

37703768
/// A helper for in place modification of strings, where we gradually "pop" characters,
37713769
/// hereby making room to write back to the string buffer
3770+
#[cfg(not(no_global_oom_handling))]
37723771
#[unstable(issue = "none", feature = "std_internals")]
37733772
struct WriteChars<'a> {
37743773
// This is the internal buffer of the string temporarily changed to Vec<u8> because
@@ -3786,6 +3785,7 @@ struct WriteChars<'a> {
37863785
buffer: VecDeque<u8>,
37873786
}
37883787

3788+
#[cfg(not(no_global_oom_handling))]
37893789
#[unstable(issue = "none", feature = "std_internals")]
37903790
impl<'a> WriteChars<'a> {
37913791
fn new(s: &'a mut String, offset: usize) -> Self {

0 commit comments

Comments
 (0)