Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot destructure structs cross crates #3767

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 resolution
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

3 participants