rust/tests/ui/closures/2229_closure_analysis/issue-118144.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
368 B
Rust
Raw Normal View History

// Regression test for ICE #118144
struct V(i32);
fn func(func_arg: &mut V) {
|| {
// Declaring `x` separately instead of using
// a destructuring binding like `let V(x) = ...`
// becaue only `V(x) = ...` triggers the ICE
let x;
V(x) = func_arg; //~ ERROR: mismatched types
func_arg.0 = 0;
};
}
fn main() {}