Skip to content

Commit a619865

Browse files
committed
Add test for issue-77911
1 parent af337e8 commit a619865

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/ui/mir/issue-77911.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// compile-flags: -Z mir-opt-level=2
2+
// ignore-cloudabi no std::fs
3+
// build-pass
4+
5+
use std::fs::File;
6+
use std::io::{BufRead, BufReader};
7+
8+
fn file_lines() -> impl Iterator<Item = String> {
9+
BufReader::new(File::open("").unwrap())
10+
.lines()
11+
.map(Result::unwrap)
12+
}
13+
14+
fn main() {
15+
for _ in file_lines() {}
16+
}

0 commit comments

Comments
 (0)