Commit 1581f56
authored
Rollup merge of rust-lang#130822 - bjoernager:non-null-from-ref, r=dtolnay
Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.
Relevant tracking issue: rust-lang#130823
The `core::ptr::NonNull` type should have the convenience constructors `from_ref` and `from_mut` for parity with `core::ptr::from_ref` and `core::ptr::from_mut`.
Although the type in question already implements `From<&T>` and `From<&mut T>`, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).2 files changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
233 | 251 | | |
234 | 252 | | |
235 | 253 | | |
| |||
1753 | 1771 | | |
1754 | 1772 | | |
1755 | 1773 | | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
| 1774 | + | |
| 1775 | + | |
1759 | 1776 | | |
1760 | 1777 | | |
1761 | 1778 | | |
| |||
1765 | 1782 | | |
1766 | 1783 | | |
1767 | 1784 | | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
| 1785 | + | |
| 1786 | + | |
1771 | 1787 | | |
1772 | 1788 | | |
0 commit comments