Skip to content

Commit a9f5f2c

Browse files
author
The Miri Cronjob Bot
committed
Merge ref 'e004014d1bf4' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: e004014 Filtered ref: d62798e442c1c6ec461725b87dacc87c285259c8 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 3f19c9e + ecee503 commit a9f5f2c

File tree

52 files changed

+1754
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1754
-1410
lines changed

alloc/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
#![feature(unicode_internals)]
160160
#![feature(unsize)]
161161
#![feature(unwrap_infallible)]
162+
#![feature(wtf8_internals)]
162163
// tidy-alphabetical-end
163164
//
164165
// Language features:
@@ -232,6 +233,8 @@ pub mod sync;
232233
#[cfg(all(not(no_global_oom_handling), not(no_rc), not(no_sync)))]
233234
pub mod task;
234235
pub mod vec;
236+
#[cfg(all(not(no_rc), not(no_sync), not(no_global_oom_handling)))]
237+
pub mod wtf8;
235238

236239
#[doc(hidden)]
237240
#[unstable(feature = "liballoc_internals", issue = "none", reason = "implementation detail")]

alloc/src/string.rs

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,68 +2939,41 @@ impl SpecToString for i8 {
29392939
}
29402940
}
29412941

2942-
// Generic/generated code can sometimes have multiple, nested references
2943-
// for strings, including `&&&str`s that would never be written
2944-
// by hand. This macro generates twelve layers of nested `&`-impl
2945-
// for primitive strings.
2946-
#[cfg(not(no_global_oom_handling))]
2947-
macro_rules! to_string_str_wrap_in_ref {
2948-
{x $($x:ident)*} => {
2949-
&to_string_str_wrap_in_ref! { $($x)* }
2950-
};
2951-
{} => { str };
2952-
}
2953-
#[cfg(not(no_global_oom_handling))]
2954-
macro_rules! to_string_expr_wrap_in_deref {
2955-
{$self:expr ; x $($x:ident)*} => {
2956-
*(to_string_expr_wrap_in_deref! { $self ; $($x)* })
2957-
};
2958-
{$self:expr ;} => { $self };
2959-
}
29602942
#[cfg(not(no_global_oom_handling))]
29612943
macro_rules! to_string_str {
2962-
{$($($x:ident)*),+} => {
2944+
{$($type:ty,)*} => {
29632945
$(
2964-
impl SpecToString for to_string_str_wrap_in_ref!($($x)*) {
2946+
impl SpecToString for $type {
29652947
#[inline]
29662948
fn spec_to_string(&self) -> String {
2967-
String::from(to_string_expr_wrap_in_deref!(self ; $($x)*))
2949+
let s: &str = self;
2950+
String::from(s)
29682951
}
29692952
}
2970-
)+
2953+
)*
29712954
};
29722955
}
29732956

29742957
#[cfg(not(no_global_oom_handling))]
29752958
to_string_str! {
2976-
x x x x x x x x x x x x,
2977-
x x x x x x x x x x x,
2978-
x x x x x x x x x x,
2979-
x x x x x x x x x,
2980-
x x x x x x x x,
2981-
x x x x x x x,
2982-
x x x x x x,
2983-
x x x x x,
2984-
x x x x,
2985-
x x x,
2986-
x x,
2987-
x,
2988-
}
2989-
2990-
#[cfg(not(no_global_oom_handling))]
2991-
impl SpecToString for Cow<'_, str> {
2992-
#[inline]
2993-
fn spec_to_string(&self) -> String {
2994-
self[..].to_owned()
2995-
}
2996-
}
2997-
2998-
#[cfg(not(no_global_oom_handling))]
2999-
impl SpecToString for String {
3000-
#[inline]
3001-
fn spec_to_string(&self) -> String {
3002-
self.to_owned()
3003-
}
2959+
Cow<'_, str>,
2960+
String,
2961+
// Generic/generated code can sometimes have multiple, nested references
2962+
// for strings, including `&&&str`s that would never be written
2963+
// by hand.
2964+
&&&&&&&&&&&&str,
2965+
&&&&&&&&&&&str,
2966+
&&&&&&&&&&str,
2967+
&&&&&&&&&str,
2968+
&&&&&&&&str,
2969+
&&&&&&&str,
2970+
&&&&&&str,
2971+
&&&&&str,
2972+
&&&&str,
2973+
&&&str,
2974+
&&str,
2975+
&str,
2976+
str,
30042977
}
30052978

30062979
#[cfg(not(no_global_oom_handling))]

0 commit comments

Comments
 (0)