]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20644.rs
Merge commit '15c8d31392b9fbab3b3368b67acc4bbe5983115a' into cranelift-rebase
[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
11 #![feature(os)]
12
13 use std::iter;
14 use std::os;
15 use std::fs::File;
16 use std::io::prelude::*;
17 use std::env;
18 use std::path::Path;
19
20 pub fn parse_summary<R: Read>(_: R, _: &Path) {
21      let path_from_root = Path::new("");
22      Path::new(&iter::repeat("../")
23                .take(path_from_root.components().count() - 1)
24                .collect::<String>());
25  }
26
27 fn foo() {
28     let cwd = env::current_dir().unwrap();
29     let src = cwd.clone();
30     let summary = File::open(&src.join("SUMMARY.md")).unwrap();
31     let _ = parse_summary(summary, &src);
32 }
33
34 fn main() {}