]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-26619.rs
1 pub struct History
<'a
> { pub _s: &'a str }
4 pub fn get_page(&self) {
5 for s
in vec
!["1|2".to_string()].into_iter().filter_map(|ref line
| self.make_entry(line
)) {
6 //~^ ERROR cannot return value referencing function parameter
11 fn make_entry(&self, s
: &'a String
) -> Option
<&str> {
12 let parts
: Vec
<_
> = s
.split('
|'
).collect();
13 println
!("{:?} -> {:?}", s
, parts
);
15 if let [commit
, ..] = &parts
[..] { Some(commit) }
else { None }
20 let h
= History{ _s: "" }
;