Skip to content

ICE compiling rustbook #20644

Closed
Closed
@nikomatsakis

Description

@nikomatsakis

@steveklabnik's changes to rust-book encountered an ICE. I reduced it to this:

// A reduced version of the rustbook ice. The problem this encountered
// had to do with trans ignoring binders.

#![feature(slicing_syntax)]
#![feature(associated_types)]
#![feature(macro_rules)]

use std::iter;
use std::os;
use std::io::File;

#[allow(unused)]
pub fn parse_summary<R: Reader>(_: R, _: &Path) {
     let path_from_root = Path::new("");
     Path::new(iter::repeat("../")
               .take(path_from_root.components().count() - 1)
               .collect::<String>());
 }

fn main() {
    let cwd = os::getcwd().unwrap();
    let src = cwd.clone();
    let summary = File::open(&src.join("SUMMARY.md"));
    let _ = parse_summary(summary, &src);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions