File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -580,10 +580,10 @@ However, the language provides a workaround.
580
580
581
581
As a special case, an ` enum ` is eligible for the "nullable pointer optimization" if it
582
582
contains exactly two variants, one of which contains no data and the other contains
583
- a single field of one of the non-nullable types listed above. This means it is represented
584
- as a single pointer, and the non-data variant is represented as the null pointer. This is
585
- called an "optimization", but unlike other optimizations it is guaranteed to apply to
586
- eligible types.
583
+ a single field of one of the non-nullable types listed above (or a struct containing such a type).
584
+ This means it is represented as a single pointer, and the non-data variant is represented as a
585
+ null pointer. This is called an "optimization", but unlike other optimizations it is guaranteed
586
+ to apply to eligible types.
587
587
588
588
The most common type that takes advantage of the nullable pointer optimization is ` Option<T> ` ,
589
589
where ` None ` corresponds to ` null ` . So ` Option<extern "C" fn(c_int) -> c_int> ` is a correct way
You can’t perform that action at this time.
0 commit comments