]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-71546.rs
Auto merge of #93765 - zhangyunhao116:heapsort, r=m-ou-se
[rust.git] / src / test / ui / borrowck / issue-71546.rs
1 // Regression test for #71546.
2
3 pub fn serialize_as_csv<V>(value: &V) -> Result<String, &str>
4 where
5     V: 'static,
6     for<'a> &'a V: IntoIterator,
7     for<'a> <&'a V as IntoIterator>::Item: ToString + 'static,
8 {
9     let csv_str: String = value
10         //~^ ERROR higher-ranked lifetime error
11         //~| ERROR higher-ranked lifetime error
12         //~| ERROR higher-ranked lifetime error
13         .into_iter()
14         .map(|elem| elem.to_string())
15         //~^ ERROR higher-ranked lifetime error
16         .collect::<String>();
17         //~^ ERROR higher-ranked lifetime error
18     Ok(csv_str)
19 }
20
21 fn main() {}