Skip to content

Can't construct type alias for tuple struct #43209

Closed
@philipc

Description

@philipc

The following code fails to compile, but it seems correct to me:

struct Foo(u32);
type Bar = Foo;

fn main() {
    let foo = Foo(1);
    let bar = Bar(2);
    // error[E0423]: expected function, found type alias `Bar`
}

One alternative is use Foo as Bar;, but that doesn't allow me to give a different doc comment for Bar.

#42601 is a closely related issue (or even the same).

Meta

rustc 1.18.0 (03fc9d6 2017-06-06)
binary: rustc
commit-hash: 03fc9d6
commit-date: 2017-06-06
host: x86_64-unknown-linux-gnu
release: 1.18.0
LLVM version: 3.9

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