Commit 73bca2b
committed
Auto merge of #46094 - dtolnay:is_null, r=alexcrichton
Remove `T: Sized` on `ptr::is_null()`
Originally from #44932 -- this is purely a revert of the last commit of that PR, which was removing some changes from the previous commits in the PR. So a revert of a revert means this is code written by @cuviper!
@mikeyhew makes a compelling case in rust-lang/rfcs#433 (comment) for why this is the right way to implement `is_null` for trait objects. And the behavior for slices makes sense to me as well.
```diff
impl<T: ?Sized> *const T {
- pub fn is_null(self) -> bool where T: Sized;
+ pub fn is_null(self) -> bool;
}
impl<T: ?Sized> *mut T {
- pub fn is_null(self) -> bool where T: Sized;
+ pub fn is_null(self) -> bool;
}3 files changed
+55
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
477 | 482 | | |
478 | 483 | | |
479 | 484 | | |
| |||
485 | 490 | | |
486 | 491 | | |
487 | 492 | | |
488 | | - | |
489 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
490 | 497 | | |
491 | 498 | | |
492 | 499 | | |
| |||
518 | 525 | | |
519 | 526 | | |
520 | 527 | | |
521 | | - | |
522 | | - | |
523 | | - | |
| 528 | + | |
524 | 529 | | |
525 | 530 | | |
526 | 531 | | |
| |||
1107 | 1112 | | |
1108 | 1113 | | |
1109 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1110 | 1120 | | |
1111 | 1121 | | |
1112 | 1122 | | |
| |||
1118 | 1128 | | |
1119 | 1129 | | |
1120 | 1130 | | |
1121 | | - | |
1122 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1123 | 1135 | | |
1124 | 1136 | | |
1125 | 1137 | | |
| |||
1151 | 1163 | | |
1152 | 1164 | | |
1153 | 1165 | | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
| 1166 | + | |
1157 | 1167 | | |
1158 | 1168 | | |
1159 | 1169 | | |
| |||
1277 | 1287 | | |
1278 | 1288 | | |
1279 | 1289 | | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
| 1290 | + | |
1283 | 1291 | | |
1284 | 1292 | | |
1285 | 1293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
65 | 98 | | |
66 | 99 | | |
67 | 100 | | |
| |||
0 commit comments