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

Problems with destructuring structs with a path to a submodule #3766

Closed
erickt opened this issue Oct 14, 2012 · 1 comment
Closed

Problems with destructuring structs with a path to a submodule #3766

erickt opened this issue Oct 14, 2012 · 1 comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Milestone

Comments

@erickt
Copy link
Contributor

erickt commented Oct 14, 2012

Here's a simple example:

mod foo {
    pub struct Foo { foo: int }
}
use foo::Foo;

struct Bar { bar: int }

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

This compiles fine, but if you uncomment //let foo::Foo { foo: _foo } = foo::Foo { foo: 1 }; it will error out with:

test.rs:10:17: 10:18 error: expected `;` but found `{`
test.rs:10     let foo::Foo { foo: _foo } = foo::Foo { foo: 1 };
                            ^
@pcwalton
Copy link
Contributor

Fixed in 184f510.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 29, 2024
better diagnostics for Tree Borrows + int2ptr casts

- Entirely reject `-Zmiri-permissive-provenance -Zmiri-tree-borrows` since that combination just doesn't work
- In the int2ptr cast warning, when Tree Borrows is enabled, do not recommend `-Zmiri-permissive-provenance`, instead note that Tree Borrows does not support int2ptr casts

Fixes rust-lang/miri#3764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Projects
None yet
Development

No branches or pull requests

2 participants