Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Struct Update/ Functional record update syntax error #32

Closed
rust-lang/rust
#81291
@arora-aman

Description

@arora-aman
struct X {
    a : String,
    b : String,
    c : String,
}

impl X {
    fn from_other_X(o: Self) -> Self {
        let c = || {
            X { a: "".into(), ..o }
        };
        c()
    }
}

The closure captures o.b, and o.c. But in MIR we expect to see *o which causes issues

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions