Skip to content

rustc ICE's when path is a directory #5806

Description

@metajack

To replicate:

% mkdir /tmp/iss5806_dir ; \
   echo '#[path = "iss5806_dir"] pub mod iss5806_mod;' > /tmp/iss5806.rs ; \
   echo 'pub fn main() { println("Hello World"); }' >> /tmp/iss5806.rs ; \
   RUST_LOG=rustc=1 rustc  /tmp/iss5806.rs
rust: task failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/libstd/io.rs:928
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/rustc.rc:398
rust: domain main @0x7fd1c1814210 root task failed

(Original report follows:)

I had code like this:

#[cfg(target_os="macos")]
#[path = "linux"]
pub mod font;

This causes rustc to spin forever. Here's the interesting part of the stack trace:

https://gist.github.com/metajack/5347891

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions