]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20644.rs
Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyup
[rust.git] / src / test / ui / issues / issue-20644.rs
1 // build-pass
2 #![allow(dead_code)]
3 #![allow(unused_imports)]
4 #![allow(stable_features)]
5
6 // A reduced version of the rustbook ice. The problem this encountered
7 // had to do with codegen ignoring binders.
8
9 // pretty-expanded FIXME #23616
10 // ignore-cloudabi no std::fs
11
12 #![feature(os)]
13
14 use std::iter;
15 use std::os;
16 use std::fs::File;
17 use std::io::prelude::*;
18 use std::env;
19 use std::path::Path;
20
21 pub fn parse_summary<R: Read>(_: R, _: &Path) {
22      let path_from_root = Path::new("");
23      Path::new(&iter::repeat("../")
24                .take(path_from_root.components().count() - 1)
25                .collect::<String>());
26  }
27
28 fn foo() {
29     let cwd = env::current_dir().unwrap();
30     let src = cwd.clone();
31     let summary = File::open(&src.join("SUMMARY.md")).unwrap();
32     let _ = parse_summary(summary, &src);
33 }
34
35 fn main() {}