stabilize ptr_offset_from
This stabilizes ptr::offset_from, and closes https://github.com/rust-lang/rust/issues/41079. It also removes the deprecated `wrapping_offset_from`. This function was deprecated 19 days ago and was never stable; given an FCP of 10 days and some waiting time until FCP starts, that leaves at least a month between deprecation and removal which I think is fine for a nightly-only API.
Regarding the open questions in https://github.com/rust-lang/rust/issues/41079:
* Should offset_from abort instead of panic on ZSTs? -- As far as I know, there is no precedent for such aborts. We could, however, declare this UB. Given that the size is always known statically and the check thus rather cheap, UB seems excessive.
* Should there be more methods like this with different restrictions (to allow nuw/nsw, perhaps) or that return usize (like how isize-taking offset is more conveniently done with usize-taking add these days)? -- No reason to block stabilization on that, we can always add such methods later.
Also nominating the lang team because this exposes an intrinsic.
The stabilized method is best described [by its doc-comment](
|
||
|---|---|---|
| .. | ||
| clean | ||
| formats | ||
| html | ||
| json | ||
| passes | ||
| test | ||
| theme | ||
| Cargo.toml | ||
| config.rs | ||
| core.rs | ||
| docfs.rs | ||
| doctree.rs | ||
| error.rs | ||
| externalfiles.rs | ||
| fold.rs | ||
| lib.rs | ||
| markdown.rs | ||
| README.md | ||
| test.rs | ||
| theme.rs | ||
| visit_ast.rs | ||
| visit_lib.rs | ||
For more information about how librustdoc works, see the rustc dev guide.