Skip to content

Commit d7c62c4

Browse files
author
Clar Charr
committed
Fix FRU.
1 parent aa2502f commit d7c62c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

text/0000-non-exhaustive.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ constructor to `pub(crate)` if it were marked as `pub`.
442442

443443
## Functional record updates
444444

445-
Functional record updates will operate exactly the same regardless of whether
446-
structs are marked as non-exhaustive or not. For example, given this struct:
445+
Functional record updates will operate very similarly to if the struct had an
446+
extra, private field. Take this example:
447447

448448
```
449449
#[derive(Debug)]
@@ -460,14 +460,16 @@ impl Default for Config {
460460
}
461461
```
462462

463-
The below code will print `Config { width: 1920, height: 1080, fullscreen:
464-
false }` regardless of which crate is calling it:
463+
We'd expect this code to work without the `non_exhaustive` attribute:
465464

466465
```
467466
let c = Config { width: 1920, height: 1080, ..Config::default() };
468467
println!("{:?}", c);
469468
```
470469

470+
Although outside of the defining crate, it will not, because `Config` could, in
471+
the future, contain private fields in the future.
472+
471473
## Changes to rustdoc
472474

473475
Right now, the only indicator that rustdoc gives for non-exhaustive enums and

0 commit comments

Comments
 (0)