bors
6c1b220fd7
Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic
...
Make <*const/mut T>::offset_from `const fn`
This reenables offset_of cc @mjbshaw after https://github.com/rust-lang/rust/pull/63075 broke it
2019-11-02 22:26:54 +00:00
Oliver Scherer
88b5e945e0
Make <*const/mut T>::offset_from const fn
2019-10-11 10:40:49 +02:00
Lzu Tao
d0862ec9b0
Inline ptr::null(_mut)
even in debug builds
2019-10-02 12:22:37 +00:00
Lzu Tao
6c1b447f2e
Remove unneeded fn main
blocks from docs
2019-10-01 11:55:46 +00:00
Alexander Regueiro
b0006dff10
A few cosmetic improvements to code & comments in liballoc and libcore
2019-09-06 16:02:25 +01:00
Mazdak Farrokhzad
e9615f2487
Rollup merge of #63297 - RalfJung:ptr_offset, r=dtolnay
...
Improve pointer offset method docs
Cc @rkruppe @gnzlbg
2019-08-12 10:58:13 +02:00
Ralf Jung
0dc9e2a565
improve wrapping_ docs
2019-08-05 18:55:56 +02:00
Ralf Jung
aa72b1d3e3
note about stack-allocated variables being allocated objects
2019-08-05 18:41:33 +02:00
Ralf Jung
1f018636e3
improve align_offset docs
2019-08-05 18:38:10 +02:00
Bruce Mitchener
86633b6389
Fix typos in doc comments.
2019-08-02 01:36:36 +07:00
Mazdak Farrokhzad
b5bea2565e
Rollup merge of #61965 - phil-opp:patch-4, r=scottmcm
...
Remove mentions of removed `offset_to` method from `align_offset` docs
The `offset_to` method was deleted in https://github.com/rust-lang/rust/pull/52814 .
The replacement for the removed method is `wrapping_offset_from`. However, neither method takes an `usize` as argument, so I don't think that it makes sense to mention them.
2019-07-30 05:37:30 +02:00
Philipp Oppermann
c9c73f5d25
Refer to add
method instead of offset
...
The `align_offset` method returns an `usize`, so using `add` makes more sense than using `offset`, which takes an `isize`.
2019-07-17 17:25:43 +02:00
Simon Sapin
8040c54b08
Stabilize <*mut _>::cast and <*const _>::cast
...
FCP: https://github.com/rust-lang/rust/issues/60602#issuecomment-511146402
2019-07-16 08:51:53 +02:00
Freyskeyd
bc322af444
doc(ptr): add example for {read,write}_unaligned
...
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
2019-07-09 16:55:00 +02:00
Mazdak Farrokhzad
d3569ddf32
Rollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung
...
Clarify unaligned fields in ptr::{read,write}_unaligned
r? @RalfJung
2019-07-05 13:53:07 +02:00
Mazdak Farrokhzad
54527db7b0
ptr::{read,write}_unaligned: use no_run and reword slightly.
2019-07-04 09:54:37 +02:00
Mazdak Farrokhzad
bee964c502
Clarify unaligned fields in ptr::read_unaligned.
2019-07-04 05:32:38 +02:00
Ralf Jung
6225607e67
remove bogus example from drop_in_place
2019-07-03 20:14:59 +02:00
Julien Cretin
b8106b59d2
Fix meta-variable binding errors in macros
...
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
kleene operator as its binder in the left-hand side. Either it does not repeat
enough, or it uses a different operator somewhere.
This change should have no semantic impact.
2019-06-23 01:30:41 +02:00
Philipp Oppermann
fed12fad70
Remove mentions of removed offset_to
method
2019-06-19 18:46:12 +02:00
Oliver Scherer
8b21b075f7
Add functions to build raw slices
2019-06-19 09:21:44 +02:00
Ralf Jung
00bae8774c
note some safety concerns of raw-ptr-to-ref casts
2019-06-14 10:47:32 +02:00
Ralf Jung
c2e7eb6ff0
split core::ptr module into multiple files
2019-05-25 09:03:45 +02:00