Skip to content

MIR borrowck: the value of an assignment statement is uninitialized #46159

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

Closed
arielb1 opened this issue Nov 21, 2017 · 0 comments
Closed

MIR borrowck: the value of an assignment statement is uninitialized #46159

arielb1 opened this issue Nov 21, 2017 · 0 comments
Labels
A-borrow-checker Area: The borrow checker C-bug Category: This is a bug.
Milestone

Comments

@arielb1
Copy link
Contributor

arielb1 commented Nov 21, 2017

e.g..

fn main() {
    let y;
    &(y = 0);
}

Causes this spurious error:

error[E0381]: borrow of possibly uninitialized variable: `_` (Mir)
 --> ack.rs:3:5
  |
3 |     &(y = 0);
  |     ^^^^^^^^ use of possibly uninitialized `_`

error: aborting due to previous error
@arielb1 arielb1 added A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. WG-compiler-nll labels Nov 21, 2017
@arielb1 arielb1 added this to the NLL prototype milestone Nov 21, 2017
@bors bors closed this as completed in a6e24fc Dec 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-borrow-checker Area: The borrow checker C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant