We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb9107a commit a496bf9Copy full SHA for a496bf9
src/attributes/type_system.md
@@ -127,6 +127,14 @@ match message {
127
}
128
```
129
130
+It's also impossible to cast non-exhaustive types from foreign crates.
131
+```rust, ignore
132
+use othercrate::NonExhaustiveEnum;
133
+
134
+// Cannot cast a non-exhaustive enum outside of its defining crate.
135
+let _ = NonExhaustiveEnum::default() as u8;
136
+```
137
138
Non-exhaustive types are always considered inhabited in downstream crates.
139
140
[_MetaWord_]: ../attributes.md#meta-item-attribute-syntax
0 commit comments