Skip to content

Generic Tuple-like Structs do not work cross-crate #7899

Closed
@auroranockert

Description

@auroranockert

First the crate testcrate.rs,

pub struct V2<T>(T, T);

then the actual test,

extern mod testcrate;

fn main() {
    let f = testcrate::V2(1.0f32, 2.0f32);
}

This gives the unexpected error,

test-run.rs:4:26: 4:32 error: mismatched types: expected `BUG[0]` but found `f32` (expected type parameter but found f32)
test-run.rs:4     let f = testcrate::V2(1.0f32, 2.0f32);
                                        ^~~~~~
test-run.rs:4:34: 4:40 error: mismatched types: expected `BUG[0]` but found `f32` (expected type parameter but found f32)
test-run.rs:4     let f = testcrate::V2(1.0f32, 2.0f32);
                                                ^~~~~~
error: aborting due to 2 previous errors
rust: task failed at 'explicit failure', /Users/Jens/Code/Git/rust/src/libsyntax/diagnostic.rs:96
rust: task failed at 'explicit failure', /Users/Jens/Code/Git/rust/src/librustc/rustc.rs:360
rust: domain main @0x7fd292008410 root task failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metadataArea: Crate metadataA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions