Skip to content

Cannot destructure structs cross crates #3767

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
erickt opened this issue Oct 14, 2012 · 2 comments
Closed

Cannot destructure structs cross crates #3767

erickt opened this issue Oct 14, 2012 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Milestone

Comments

@erickt
Copy link
Contributor

erickt commented Oct 14, 2012

This is an even worse version of #3766. There's no way that I can figure out to get destructuring a struct cross crates working. Here's an example:

foo.rs:

pub struct Foo {
    foo: int,
}

bar.rs:

extern mod foo;
use foo::Foo;

fn main() {
    let Foo { foo: _foo }  = Foo { foo: 1 };
}

Errors with:

bar.rs:5:8: 5:11 error: `Foo` does not name a structure
bar.rs:5     let Foo { foo: _foo }  = Foo { foo: 1 };
                 ^~~
error: aborting due to previous error
@bblum
Copy link
Contributor

bblum commented Oct 19, 2012

wonder if this is related to #3177

@pcwalton
Copy link
Contributor

Fixed in 3f78e0e.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

3 participants