Skip to content

Apparent rustc hang on malformed trait declaration #32069

Closed
@sapphire-arches

Description

@sapphire-arches

rustc appears to hang when there is a malformed trait declaration in a submodule. Specifically, I am able to reliably induce the hang with the following setup:

  1. Create a new project with cargo new --bin bugtest
  2. mkdir src/ui
  3. Put the following code in src/ui/mod.rs
pub trait Widget {
    pub fn draw(&self)
}

cargo build will appear to hang. I'm not sure if it's an infinite loop, or just really really slow.

Note the lack of a semicolon after the function declaration. While this is indeed malformed rust code, I would not expect the compiler to be extraordinarily slow to parse this code.

Meta

rustc --version --verbose:

rustc 1.9.0-nightly (7b0b80ae2 2016-03-02)
binary: rustc
commit-hash: 7b0b80ae21a195a5dba91d557f94a96136c27eaf
commit-date: 2016-03-02
host: x86_64-unknown-linux-gnu
release: 1.9.0-nightly

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