]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20644.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-20644.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-pass
12 #![allow(dead_code)]
13 #![allow(unused_imports)]
14 #![allow(stable_features)]
15
16 // A reduced version of the rustbook ice. The problem this encountered
17 // had to do with codegen ignoring binders.
18
19 // pretty-expanded FIXME #23616
20 // ignore-cloudabi no std::fs
21
22 #![feature(os)]
23
24 use std::iter;
25 use std::os;
26 use std::fs::File;
27 use std::io::prelude::*;
28 use std::env;
29 use std::path::Path;
30
31 pub fn parse_summary<R: Read>(_: R, _: &Path) {
32      let path_from_root = Path::new("");
33      Path::new(&iter::repeat("../")
34                .take(path_from_root.components().count() - 1)
35                .collect::<String>());
36  }
37
38 fn foo() {
39     let cwd = env::current_dir().unwrap();
40     let src = cwd.clone();
41     let summary = File::open(&src.join("SUMMARY.md")).unwrap();
42     let _ = parse_summary(summary, &src);
43 }
44
45 fn main() {}