mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
16 lines
295 B
Rust
16 lines
295 B
Rust
//@ compile-flags: -Z mir-opt-level=3
|
|
//@ build-pass
|
|
|
|
use std::fs::File;
|
|
use std::io::{BufRead, BufReader};
|
|
|
|
fn file_lines() -> impl Iterator<Item = String> {
|
|
BufReader::new(File::open("").unwrap())
|
|
.lines()
|
|
.map(Result::unwrap)
|
|
}
|
|
|
|
fn main() {
|
|
for _ in file_lines() {}
|
|
}
|