2015-01-06 04:03:42 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_imports)]
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(stable_features)]
|
|
|
|
|
2015-01-06 04:03:42 -06:00
|
|
|
// A reduced version of the rustbook ice. The problem this encountered
|
2018-05-08 08:10:16 -05:00
|
|
|
// had to do with codegen ignoring binders.
|
2015-01-06 04:03:42 -06:00
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
2018-01-02 07:11:41 -06:00
|
|
|
// ignore-cloudabi no std::fs
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-05 20:33:58 -06:00
|
|
|
#![feature(os)]
|
|
|
|
|
2015-01-06 04:03:42 -06:00
|
|
|
use std::iter;
|
|
|
|
use std::os;
|
2015-03-17 15:33:26 -05:00
|
|
|
use std::fs::File;
|
|
|
|
use std::io::prelude::*;
|
|
|
|
use std::env;
|
|
|
|
use std::path::Path;
|
2015-01-06 04:03:42 -06:00
|
|
|
|
2015-03-17 15:33:26 -05:00
|
|
|
pub fn parse_summary<R: Read>(_: R, _: &Path) {
|
2015-01-06 04:03:42 -06:00
|
|
|
let path_from_root = Path::new("");
|
2015-03-17 15:33:26 -05:00
|
|
|
Path::new(&iter::repeat("../")
|
2015-01-06 04:03:42 -06:00
|
|
|
.take(path_from_root.components().count() - 1)
|
|
|
|
.collect::<String>());
|
|
|
|
}
|
|
|
|
|
2015-03-17 15:33:26 -05:00
|
|
|
fn foo() {
|
|
|
|
let cwd = env::current_dir().unwrap();
|
2015-01-06 04:03:42 -06:00
|
|
|
let src = cwd.clone();
|
2015-03-17 15:33:26 -05:00
|
|
|
let summary = File::open(&src.join("SUMMARY.md")).unwrap();
|
2015-01-06 04:03:42 -06:00
|
|
|
let _ = parse_summary(summary, &src);
|
|
|
|
}
|
2015-03-17 15:33:26 -05:00
|
|
|
|
|
|
|
fn main() {}
|