2015-01-06 10:03:42 +00: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.
|
|
|
|
|
|
|
|
// A reduced version of the rustbook ice. The problem this encountered
|
2018-05-08 13:10:16 +00:00
|
|
|
// had to do with codegen ignoring binders.
|
2015-01-06 10:03:42 +00:00
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
// pretty-expanded FIXME #23616
|
2018-01-02 13:11:41 +00:00
|
|
|
// ignore-cloudabi no std::fs
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-03-06 02:33:58 +00:00
|
|
|
#![feature(os)]
|
|
|
|
|
2015-01-06 10:03:42 +00:00
|
|
|
use std::iter;
|
|
|
|
use std::os;
|
2015-03-17 20:33:26 +00:00
|
|
|
use std::fs::File;
|
|
|
|
use std::io::prelude::*;
|
|
|
|
use std::env;
|
|
|
|
use std::path::Path;
|
2015-01-06 10:03:42 +00:00
|
|
|
|
2015-03-17 20:33:26 +00:00
|
|
|
pub fn parse_summary<R: Read>(_: R, _: &Path) {
|
2015-01-06 10:03:42 +00:00
|
|
|
let path_from_root = Path::new("");
|
2015-03-17 20:33:26 +00:00
|
|
|
Path::new(&iter::repeat("../")
|
2015-01-06 10:03:42 +00:00
|
|
|
.take(path_from_root.components().count() - 1)
|
|
|
|
.collect::<String>());
|
|
|
|
}
|
|
|
|
|
2015-03-17 20:33:26 +00:00
|
|
|
fn foo() {
|
|
|
|
let cwd = env::current_dir().unwrap();
|
2015-01-06 10:03:42 +00:00
|
|
|
let src = cwd.clone();
|
2015-03-17 20:33:26 +00:00
|
|
|
let summary = File::open(&src.join("SUMMARY.md")).unwrap();
|
2015-01-06 10:03:42 +00:00
|
|
|
let _ = parse_summary(summary, &src);
|
|
|
|
}
|
2015-03-17 20:33:26 +00:00
|
|
|
|
|
|
|
fn main() {}
|