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

[DRAFT] RFC: Gradual struct initialization #16

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
rfc, gradual-struct-init: clarify (9).
  • Loading branch information
Centril committed Nov 2, 2018
commit a9a7ec83e8b6ae4c1ba74a1983f63ac4c22f354f
3 changes: 3 additions & 0 deletions text/0000-gradual-struct-init.md
Original file line number Diff line number Diff line change
@@ -264,6 +264,9 @@ if random_bool() {
// nothing here.
}

// foo.qux = 2; -- adding this line would not help because now `foo.qux` may
// be initialized twice and `foo` is not a `mut` binding.

consume(foo); // ERROR! `foo.qux` not initialized in `else { .. }`.
```