diff --git a/library/alloc/src/boxed/iter.rs b/library/alloc/src/boxed/iter.rs index 0e6afcf062354..adaa85d7d9eec 100644 --- a/library/alloc/src/boxed/iter.rs +++ b/library/alloc/src/boxed/iter.rs @@ -93,55 +93,55 @@ impl AsyncIterator for Box { } } -/// This implementation is required to make sure that the `Box<[I]>: IntoIterator` +/// This implementation is required to make sure that the `Box<[T]>: IntoIterator` /// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket. #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl !Iterator for Box<[I], A> {} +impl !Iterator for Box<[T], A> {} -/// This implementation is required to make sure that the `&Box<[I]>: IntoIterator` +/// This implementation is required to make sure that the `&Box<[T]>: IntoIterator` /// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket. #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A> {} +impl<'a, T, A: Allocator> !Iterator for &'a Box<[T], A> {} -/// This implementation is required to make sure that the `&mut Box<[I]>: IntoIterator` +/// This implementation is required to make sure that the `&mut Box<[T]>: IntoIterator` /// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket. #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl<'a, I, A: Allocator> !Iterator for &'a mut Box<[I], A> {} +impl<'a, T, A: Allocator> !Iterator for &'a mut Box<[T], A> {} // Note: the `#[rustc_skip_during_method_dispatch(boxed_slice)]` on `trait IntoIterator` // hides this implementation from explicit `.into_iter()` calls on editions < 2024, // so those calls will still resolve to the slice implementation, by reference. #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl IntoIterator for Box<[I], A> { - type IntoIter = vec::IntoIter; - type Item = I; - fn into_iter(self) -> vec::IntoIter { +impl IntoIterator for Box<[T], A> { + type IntoIter = vec::IntoIter; + type Item = T; + fn into_iter(self) -> vec::IntoIter { self.into_vec().into_iter() } } #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl<'a, I, A: Allocator> IntoIterator for &'a Box<[I], A> { - type IntoIter = slice::Iter<'a, I>; - type Item = &'a I; - fn into_iter(self) -> slice::Iter<'a, I> { +impl<'a, T, A: Allocator> IntoIterator for &'a Box<[T], A> { + type IntoIter = slice::Iter<'a, T>; + type Item = &'a T; + fn into_iter(self) -> slice::Iter<'a, T> { self.iter() } } #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] -impl<'a, I, A: Allocator> IntoIterator for &'a mut Box<[I], A> { - type IntoIter = slice::IterMut<'a, I>; - type Item = &'a mut I; - fn into_iter(self) -> slice::IterMut<'a, I> { +impl<'a, T, A: Allocator> IntoIterator for &'a mut Box<[T], A> { + type IntoIter = slice::IterMut<'a, T>; + type Item = &'a mut T; + fn into_iter(self) -> slice::IterMut<'a, T> { self.iter_mut() } } #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_slice_from_iter", since = "1.32.0")] -impl FromIterator for Box<[I]> { - fn from_iter>(iter: T) -> Self { +impl FromIterator for Box<[T]> { + fn from_iter>(iter: I) -> Self { iter.into_iter().collect::>().into_boxed_slice() } } @@ -149,7 +149,7 @@ impl FromIterator for Box<[I]> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl FromIterator for Box { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } @@ -157,7 +157,7 @@ impl FromIterator for Box { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl<'a> FromIterator<&'a char> for Box { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } @@ -165,7 +165,7 @@ impl<'a> FromIterator<&'a char> for Box { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl<'a> FromIterator<&'a str> for Box { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } @@ -173,7 +173,7 @@ impl<'a> FromIterator<&'a str> for Box { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl FromIterator for Box { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } @@ -181,7 +181,7 @@ impl FromIterator for Box { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl FromIterator> for Box { - fn from_iter>>(iter: T) -> Self { + fn from_iter>>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } @@ -189,7 +189,7 @@ impl FromIterator> for Box { #[cfg(not(no_global_oom_handling))] #[stable(feature = "boxed_str_from_iter", since = "1.80.0")] impl<'a> FromIterator> for Box { - fn from_iter>>(iter: T) -> Self { + fn from_iter>>(iter: I) -> Self { String::from_iter(iter).into_boxed_str() } } diff --git a/library/alloc/src/bstr.rs b/library/alloc/src/bstr.rs index 9aa3064da886f..d45c06427aabf 100644 --- a/library/alloc/src/bstr.rs +++ b/library/alloc/src/bstr.rs @@ -281,7 +281,7 @@ impl<'a> From<&'a ByteString> for Cow<'a, ByteStr> { #[unstable(feature = "bstr", issue = "134915")] impl FromIterator for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { ByteString(iter.into_iter().collect::().into_bytes()) } } @@ -289,7 +289,7 @@ impl FromIterator for ByteString { #[unstable(feature = "bstr", issue = "134915")] impl FromIterator for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { ByteString(iter.into_iter().collect()) } } @@ -297,7 +297,7 @@ impl FromIterator for ByteString { #[unstable(feature = "bstr", issue = "134915")] impl<'a> FromIterator<&'a str> for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { ByteString(iter.into_iter().collect::().into_bytes()) } } @@ -305,7 +305,7 @@ impl<'a> FromIterator<&'a str> for ByteString { #[unstable(feature = "bstr", issue = "134915")] impl<'a> FromIterator<&'a [u8]> for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { let mut buf = Vec::new(); for b in iter { buf.extend_from_slice(b); @@ -317,7 +317,7 @@ impl<'a> FromIterator<&'a [u8]> for ByteString { #[unstable(feature = "bstr", issue = "134915")] impl<'a> FromIterator<&'a ByteStr> for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { let mut buf = Vec::new(); for b in iter { buf.extend_from_slice(&b.0); @@ -329,7 +329,7 @@ impl<'a> FromIterator<&'a ByteStr> for ByteString { #[unstable(feature = "bstr", issue = "134915")] impl FromIterator for ByteString { #[inline] - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { let mut buf = Vec::new(); for mut b in iter { buf.append(&mut b.0); diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index d8421d3c3f70a..a9b3a3787f057 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -2541,7 +2541,7 @@ impl FromIterator<(K, V)> for BTreeMap { /// /// If the iterator produces any pairs with equal keys, /// all but one of the corresponding values will be dropped. - fn from_iter>(iter: T) -> BTreeMap { + fn from_iter>(iter: I) -> BTreeMap { let mut inputs: Vec<_> = iter.into_iter().collect(); if inputs.is_empty() { @@ -2557,7 +2557,7 @@ impl FromIterator<(K, V)> for BTreeMap { #[stable(feature = "rust1", since = "1.0.0")] impl Extend<(K, V)> for BTreeMap { #[inline] - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { iter.into_iter().for_each(move |(k, v)| { self.insert(k, v); }); diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index cc321660e6ea4..a528bb948af5e 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2480,7 +2480,7 @@ impl<'a> FromIterator> for String { #[cfg(not(no_global_oom_handling))] #[unstable(feature = "ascii_char", issue = "110998")] impl FromIterator for String { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { let buf = iter.into_iter().map(core::ascii::Char::to_u8).collect(); // SAFETY: `buf` is guaranteed to be valid UTF-8 because the `core::ascii::Char` type // only contains ASCII values (0x00-0x7F), which are valid UTF-8. @@ -2491,7 +2491,7 @@ impl FromIterator for String { #[cfg(not(no_global_oom_handling))] #[unstable(feature = "ascii_char", issue = "110998")] impl<'a> FromIterator<&'a core::ascii::Char> for String { - fn from_iter>(iter: T) -> Self { + fn from_iter>(iter: I) -> Self { let buf = iter.into_iter().copied().map(core::ascii::Char::to_u8).collect(); // SAFETY: `buf` is guaranteed to be valid UTF-8 because the `core::ascii::Char` type // only contains ASCII values (0x00-0x7F), which are valid UTF-8. @@ -3332,7 +3332,7 @@ impl<'a> FromIterator for Cow<'a, str> { #[cfg(not(no_global_oom_handling))] #[unstable(feature = "ascii_char", issue = "110998")] impl<'a> FromIterator for Cow<'a, str> { - fn from_iter>(it: T) -> Self { + fn from_iter>(it: I) -> Self { Cow::Owned(FromIterator::from_iter(it)) } } diff --git a/library/alloc/src/wtf8/mod.rs b/library/alloc/src/wtf8/mod.rs index 36ec32c549763..be9228b181d3a 100644 --- a/library/alloc/src/wtf8/mod.rs +++ b/library/alloc/src/wtf8/mod.rs @@ -423,7 +423,7 @@ impl Wtf8Buf { /// This replaces surrogate code point pairs with supplementary code points, /// like concatenating ill-formed UTF-16 strings effectively would. impl FromIterator for Wtf8Buf { - fn from_iter>(iter: T) -> Wtf8Buf { + fn from_iter>(iter: I) -> Wtf8Buf { let mut string = Wtf8Buf::new(); string.extend(iter); string @@ -435,7 +435,7 @@ impl FromIterator for Wtf8Buf { /// This replaces surrogate code point pairs with supplementary code points, /// like concatenating ill-formed UTF-16 strings effectively would. impl Extend for Wtf8Buf { - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { let iterator = iter.into_iter(); let (low, _high) = iterator.size_hint(); // Lower bound of one byte per code point (ASCII only) diff --git a/library/core/src/iter/traits/collect.rs b/library/core/src/iter/traits/collect.rs index e7e5e30b4eff5..cf79ceadf0540 100644 --- a/library/core/src/iter/traits/collect.rs +++ b/library/core/src/iter/traits/collect.rs @@ -97,41 +97,41 @@ use super::TrustedLen; #[stable(feature = "rust1", since = "1.0.0")] #[rustc_on_unimplemented( on( - Self = "&[{A}]", + Self = "&[{T}]", message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere", - label = "try explicitly collecting into a `Vec<{A}>`", + label = "try explicitly collecting into a `Vec<{T}>`", ), on( - all(A = "{integer}", any(Self = "&[{integral}]",)), + all(T = "{integer}", any(Self = "&[{integral}]",)), message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere", - label = "try explicitly collecting into a `Vec<{A}>`", + label = "try explicitly collecting into a `Vec<{T}>`", ), on( - Self = "[{A}]", + Self = "[{T}]", message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size", - label = "try explicitly collecting into a `Vec<{A}>`", + label = "try explicitly collecting into a `Vec<{T}>`", ), on( - all(A = "{integer}", any(Self = "[{integral}]",)), + all(T = "{integer}", any(Self = "[{integral}]",)), message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size", - label = "try explicitly collecting into a `Vec<{A}>`", + label = "try explicitly collecting into a `Vec<{T}>`", ), on( - Self = "[{A}; _]", + Self = "[{T}; _]", message = "an array of type `{Self}` cannot be built directly from an iterator", - label = "try collecting into a `Vec<{A}>`, then using `.try_into()`", + label = "try collecting into a `Vec<{T}>`, then using `.try_into()`", ), on( - all(A = "{integer}", any(Self = "[{integral}; _]",)), + all(T = "{integer}", any(Self = "[{integral}; _]",)), message = "an array of type `{Self}` cannot be built directly from an iterator", - label = "try collecting into a `Vec<{A}>`, then using `.try_into()`", + label = "try collecting into a `Vec<{T}>`, then using `.try_into()`", ), message = "a value of type `{Self}` cannot be built from an iterator \ - over elements of type `{A}`", - label = "value of type `{Self}` cannot be built from `std::iter::Iterator`" + over elements of type `{T}`", + label = "value of type `{Self}` cannot be built from `std::iter::Iterator`" )] #[rustc_diagnostic_item = "FromIterator"] -pub trait FromIterator: Sized { +pub trait FromIterator: Sized { /// Creates a value from an iterator. /// /// See the [module-level documentation] for more. @@ -149,7 +149,7 @@ pub trait FromIterator: Sized { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "from_iter_fn"] - fn from_iter>(iter: T) -> Self; + fn from_iter>(iter: I) -> Self; } /// Conversion into an [`Iterator`]. @@ -371,7 +371,7 @@ const impl IntoIterator for I { /// // This is a bit simpler with the concrete type signature: we can call /// // extend on anything which can be turned into an Iterator which gives /// // us i32s. Because we need i32s to put into MyCollection. -/// fn extend>(&mut self, iter: T) { +/// fn extend>(&mut self, iter: I) { /// /// // The implementation is very straightforward: loop through the /// // iterator, and add() each element to ourselves. @@ -394,7 +394,7 @@ const impl IntoIterator for I { /// assert_eq!("MyCollection([5, 6, 7, 1, 2, 3])", format!("{c:?}")); /// ``` #[stable(feature = "rust1", since = "1.0.0")] -pub trait Extend { +pub trait Extend { /// Extends a collection with the contents of an iterator. /// /// As this is the only required method for this trait, the [trait-level] docs @@ -413,11 +413,11 @@ pub trait Extend { /// assert_eq!("abcdef", &message); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - fn extend>(&mut self, iter: T); + fn extend>(&mut self, iter: I); /// Extends a collection with exactly one element. #[unstable(feature = "extend_one", issue = "72631")] - fn extend_one(&mut self, item: A) { + fn extend_one(&mut self, item: T) { self.extend(Some(item)); } @@ -442,7 +442,7 @@ pub trait Extend { // This method is for internal usage only. It is only on the trait because of specialization's limitations. #[unstable(feature = "extend_one_unchecked", issue = "none")] #[doc(hidden)] - unsafe fn extend_one_unchecked(&mut self, item: A) + unsafe fn extend_one_unchecked(&mut self, item: T) where Self: Sized, { @@ -452,7 +452,7 @@ pub trait Extend { #[stable(feature = "extend_for_unit", since = "1.28.0")] impl Extend<()> for () { - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { iter.into_iter().for_each(drop) } fn extend_one(&mut self, _item: ()) {} @@ -620,7 +620,7 @@ macro_rules! impl_extend_tuple { where $($extend_ty: Extend<$ty>,)+ { - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: Iter) { default_extend(self, iter) } diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 5d86f851dbd1d..6fa56a707de4e 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -465,7 +465,7 @@ //! [`Option`] of a collection of each contained value of the original //! [`Option`] values, or [`None`] if any of the elements was [`None`]. //! -//! [impl-FromIterator]: Option#impl-FromIterator%3COption%3CA%3E%3E-for-Option%3CV%3E +//! [impl-FromIterator]: Option#impl-FromIterator%3COption%3CT%3E%3E-for-Option%3CV%3E //! //! ``` //! let v = [Some(2), Some(4), None, Some(8)]; @@ -2786,7 +2786,7 @@ unsafe impl TrustedLen for OptionFlatten {} ///////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl> FromIterator> for Option { +impl> FromIterator> for Option { /// Takes each element in the [`Iterator`]: if it is [`None`][Option::None], /// no further elements are taken, and the [`None`][Option::None] is /// returned. Should no [`None`][Option::None] occur, a container of type @@ -2848,7 +2848,7 @@ impl> FromIterator> for Option { /// Since the third element caused an underflow, no further elements were taken, /// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16. #[inline] - fn from_iter>>(iter: I) -> Option { + fn from_iter>>(iter: I) -> Option { iter::try_process(iter.into_iter(), |i| i.collect()) } } diff --git a/library/core/src/result.rs b/library/core/src/result.rs index b257cd8c82a0e..24bbf37f3278e 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -511,7 +511,7 @@ //! [`Result`] of a collection of each contained value of the original //! [`Result`] values, or [`Err`] if any of the elements was [`Err`]. //! -//! [impl-FromIterator]: Result#impl-FromIterator%3CResult%3CA,+E%3E%3E-for-Result%3CV,+E%3E +//! [impl-FromIterator]: Result#impl-FromIterator%3CResult%3CT,+E%3E%3E-for-Result%3CV,+E%3E //! //! ``` //! let v = [Ok(2), Ok(4), Err("err!"), Ok(8)]; @@ -2112,7 +2112,7 @@ unsafe impl TrustedLen for IntoIter {} ///////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl> FromIterator> for Result { +impl> FromIterator> for Result { /// Takes each element in the `Iterator`: if it is an `Err`, no further /// elements are taken, and the `Err` is returned. Should no `Err` occur, a /// container with the values of each `Result` is returned. @@ -2156,7 +2156,7 @@ impl> FromIterator> for Result { /// Since the third element caused an underflow, no further elements were taken, /// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16. #[inline] - fn from_iter>>(iter: I) -> Result { + fn from_iter>>(iter: I) -> Result { iter::try_process(iter.into_iter(), |i| i.collect()) } } diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 2f026fb81ee1b..596e548b57e14 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -516,7 +516,7 @@ macro_rules! extend_items { $( #[stable(feature = "token_stream_extend_ts_items", since = "1.92.0")] impl Extend<$item> for TokenStream { - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { self.extend(iter.into_iter().map(TokenTree::$item)); } } diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index fef0b1b4df88e..1ac914cda0e4e 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -3010,7 +3010,7 @@ where /// /// If the iterator produces any pairs with equal keys, /// all but one of the corresponding values will be dropped. - fn from_iter>(iter: T) -> HashMap { + fn from_iter>(iter: I) -> HashMap { let mut map = HashMap::with_hasher(Default::default()); map.extend(iter); map @@ -3027,7 +3027,7 @@ where A: Allocator, { #[inline] - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { self.base.extend(iter) } @@ -3051,7 +3051,7 @@ where A: Allocator, { #[inline] - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { self.base.extend(iter) } diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 27039f0d3d2eb..36f56bf76131e 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -1815,7 +1815,7 @@ impl FromStr for OsString { #[stable(feature = "osstring_extend", since = "1.52.0")] impl Extend for OsString { #[inline] - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { for s in iter { self.push(&s); } @@ -1825,7 +1825,7 @@ impl Extend for OsString { #[stable(feature = "osstring_extend", since = "1.52.0")] impl<'a> Extend<&'a OsStr> for OsString { #[inline] - fn extend>(&mut self, iter: T) { + fn extend>(&mut self, iter: I) { for s in iter { self.push(s); } @@ -1835,7 +1835,7 @@ impl<'a> Extend<&'a OsStr> for OsString { #[stable(feature = "osstring_extend", since = "1.52.0")] impl<'a> Extend> for OsString { #[inline] - fn extend>>(&mut self, iter: T) { + fn extend>>(&mut self, iter: I) { for s in iter { self.push(&s); } diff --git a/tests/ui/suggestions/missing-assoc-fn.stderr b/tests/ui/suggestions/missing-assoc-fn.stderr index d819f7e8bd2c4..ac04f6653866e 100644 --- a/tests/ui/suggestions/missing-assoc-fn.stderr +++ b/tests/ui/suggestions/missing-assoc-fn.stderr @@ -19,7 +19,7 @@ error[E0046]: not all trait items implemented, missing: `from_iter` LL | impl FromIterator<()> for X { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_iter` in implementation | - = help: implement the missing item: `fn from_iter>(_: T) -> Self { todo!() }` + = help: implement the missing item: `fn from_iter>(_: I) -> Self { todo!() }` error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/semi-suggestion-when-stmt-and-expr-span-equal.stderr b/tests/ui/suggestions/semi-suggestion-when-stmt-and-expr-span-equal.stderr index 6dd4b1e5d5110..1f225767472ad 100644 --- a/tests/ui/suggestions/semi-suggestion-when-stmt-and-expr-span-equal.stderr +++ b/tests/ui/suggestions/semi-suggestion-when-stmt-and-expr-span-equal.stderr @@ -20,7 +20,7 @@ LL | .collect::(); | required by a bound introduced by this call | = help: the trait `FromIterator<()>` is not implemented for `String` - = help: `String` implements trait `FromIterator`: + = help: `String` implements trait `FromIterator`: FromIterator<&char> FromIterator<&std::ascii::Char> FromIterator<&str>