rust-lang / reference

The Rust Reference
https://doc.rust-lang.org/nightly/reference/
Apache License 2.0
1.16k stars 452 forks source link

Document how `non_exhaustive` interacts with tuple and unit-like structs. #1491

Closed kpreid closed 1 month ago

kpreid commented 1 month ago

I was surprised by this behavior and it led me to believe Clippy was issuing a false positive because I thought that #[non_exhaustive] was largely ineffective on unit structs. But in fact it does have notable effects, and these effects were not previously documented in the reference except in the matching section.

Closes #1097