Commit 3c66e8b
committed
Rollup merge of #52508 - joshtriplett:dangling-not-sentinel, r=Mark-Simulacrum
Document that Unique::empty() and NonNull::dangling() aren't sentinel values
The documentation of Unique::empty() and NonNull::dangling() could
potentially suggest that they work as sentinel values indicating a
not-yet-initialized pointer. However, they both declare a non-null
pointer equal to the alignment of the type, which could potentially
reference a valid value of that type (specifically, the first such valid
value in memory). Explicitly document that the return value of these
functions does not work as a sentinel value.1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2716 | 2716 | | |
2717 | 2717 | | |
2718 | 2718 | | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
2719 | 2724 | | |
2720 | 2725 | | |
2721 | 2726 | | |
| |||
2847 | 2852 | | |
2848 | 2853 | | |
2849 | 2854 | | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
2850 | 2860 | | |
2851 | 2861 | | |
2852 | 2862 | | |
| |||
0 commit comments