Skip to content

found value name used as a type with box/enum #18195

Closed
@blastrock

Description

@blastrock

Hi,

I found a very strange bug. The following code won't compile:

type Entities = Box<Entity+'static>;

trait Entity {
}

enum Shape {
    Box(f64, f64), // <--- this line breaks compilation
}

fn main() {
}

The error is:

a.rs:1:17: 1:36 error: found value name used as a type: DefVariant(DefId { krate: 0, node: 13 }, DefId { krate: 0, node: 14 }, false)
a.rs:1 type Entities = Box<Entity+'static>;
                       ^~~~~~~~~~~~~~~~~~~

But if you comment the line I marked, it will compile without problem. Tested on master today http://is.gd/Si0mUC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions