diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-05-09 18:45:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-09 18:45:37 +0200 |
| commit | f4bef2e41caf1cd1f7d0f48688499c8607de286e (patch) | |
| tree | 0a6b7c9894d8e681d1eb37afdd9da1032a4f052f | |
| parent | 6c8001b85ce0b318422e44efec1fe67690ab22d3 (diff) | |
| parent | df446cb2afd1d968abe4ac47cb8cb4076730a4f0 (diff) | |
| download | rust-f4bef2e41caf1cd1f7d0f48688499c8607de286e.tar.gz rust-f4bef2e41caf1cd1f7d0f48688499c8607de286e.zip | |
Rollup merge of #96841 - thomcc:revert-osstr-join, r=m-ou-se
Revert "Implement [OsStr]::join", which was merged without FCP. This reverts commit 4fcbc53820ab423bbeb41f07822369aa05da1d68, see https://github.com/rust-lang/rust/pull/96744. (I'm terribly sorry, and truly don't remember r+ing it, or even having seen it before yesterday, which is... genuinely very worrisome for me). r? `@m-ou-se`
| -rw-r--r-- | library/std/src/ffi/os_str.rs | 17 | ||||
| -rw-r--r-- | library/std/src/ffi/os_str/tests.rs | 14 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 2 |
3 files changed, 0 insertions, 33 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index dd316bdb2c6..9b5e5d6c0cc 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -1222,23 +1222,6 @@ impl OsStr { } } -#[unstable(feature = "slice_concat_ext", issue = "27747")] -impl<S: Borrow<OsStr>> alloc::slice::Join<&OsStr> for [S] { - type Output = OsString; - - fn join(slice: &Self, sep: &OsStr) -> OsString { - let Some(first) = slice.first() else { - return OsString::new(); - }; - let first = first.borrow().to_owned(); - slice[1..].iter().fold(first, |mut a, b| { - a.push(sep); - a.push(b.borrow()); - a - }) - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl Borrow<OsStr> for OsString { #[inline] diff --git a/library/std/src/ffi/os_str/tests.rs b/library/std/src/ffi/os_str/tests.rs index d7926749aae..283f2b577e8 100644 --- a/library/std/src/ffi/os_str/tests.rs +++ b/library/std/src/ffi/os_str/tests.rs @@ -85,20 +85,6 @@ fn test_os_string_reserve_exact() { } #[test] -fn test_os_string_join() { - let strings = [OsStr::new("hello"), OsStr::new("dear"), OsStr::new("world")]; - assert_eq!("hello", strings[..1].join(OsStr::new(" "))); - assert_eq!("hello dear world", strings.join(OsStr::new(" "))); - assert_eq!("hellodearworld", strings.join(OsStr::new(""))); - assert_eq!("hello.\n dear.\n world", strings.join(OsStr::new(".\n "))); - - assert_eq!("dear world", strings[1..].join(&OsString::from(" "))); - - let strings_abc = [OsString::from("a"), OsString::from("b"), OsString::from("c")]; - assert_eq!("a b c", strings_abc.join(OsStr::new(" "))); -} - -#[test] fn test_os_string_default() { let os_string: OsString = Default::default(); assert_eq!("", &os_string); diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index c394865d886..8ee50925f85 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -241,7 +241,6 @@ #![feature(intra_doc_pointers)] #![feature(lang_items)] #![feature(let_chains)] -#![feature(let_else)] #![feature(linkage)] #![feature(min_specialization)] #![feature(must_not_suspend)] @@ -302,7 +301,6 @@ #![feature(toowned_clone_into)] #![feature(try_reserve_kind)] #![feature(vec_into_raw_parts)] -#![feature(slice_concat_trait)] // // Library features (unwind): #![feature(panic_unwind)] |
