Skip to content

Borrowed ptr to boxed trait exposes "uniq" type #4972

Closed
@jbclements

Description

@jbclements

This isn't quite an ICE, but I think it probably should be; the following program

trait MyTrait { }

pub enum TraitWrapper {
    A(~MyTrait),
}

fn get_tw_map(tw: &lt/TraitWrapper) -> &lt/MyTrait {
    match *tw {
        A(~ref map) => map,
    }
}

... signals the error

Running /usr/local/bin/rustc:
./foo.rs:9:10: 9:19 error: mismatched types: expected `~MyTrait` found uniq
./foo.rs:9         A(~ref map) => map,
                     ^~~~~~~~~

It appears that "uniq" is the name used in midle/trans/reflect.rs for ty::vstore_uniq, in vstore_name_and_extra.

I'm guessing this isn't the desired behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions