Christoph Schmidler
12d65c28a6
Split up ptr/mod.rs in libcore, one with implementation detail for const ptr and the other with mut ptr
2019-12-19 09:01:26 +01:00
Mark Rousskov
82184440ec
Propagate cfg bootstrap
2019-12-18 12:16:19 -05:00
Oliver Scherer
5e17e39881
Require stable/unstable annotations for the constness of all stable functions with a const modifier
2019-12-13 11:27:02 +01:00
David Tolnay
c737169fe5
Format libcore with rustfmt (including tests and benches)
2019-12-06 20:20:51 -08:00
David Tolnay
24d7f72c62
Suppress libcore/ptr/mod.rs filelength lint
2019-12-06 20:16:12 -08:00
CreepySkeleton
f11dd32f75
Use intra-doc links
2019-11-27 21:36:09 +03:00
CreepySkeleton
d411dd27bf
Elaborate on std::ptr::{as_ref,as_mod} and clarify docs
2019-11-27 21:33:24 +03:00
Mark Rousskov
997feacddd
Snap cfgs
2019-11-12 16:36:57 -05:00
Mazdak Farrokhzad
379b19c17f
Rollup merge of #63793 - oli-obk: 🧹 , r=dtolnay
...
Have tidy ensure that we document all `unsafe` blocks in libcore
cc @rust-lang/libs
I documented a few and added ignore flags on the other files. We can incrementally document the files, but won't regress any files this way.
2019-11-07 14:27:20 +01:00
Oliver Scherer
02f9167f94
Have tidy ensure that we document all unsafe blocks in libcore
2019-11-06 11:04:42 +01:00
Ralf Jung
11a48a0423
Apply suggestions from code review
...
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com >
2019-11-05 21:50:55 +01:00
Ralf Jung
1a254e4f43
expand slice from_raw_part docs
2019-11-05 09:55:33 +01:00
Ralf Jung
82dc3aa5fb
link from raw slice creation methods to safety requirements
2019-11-05 09:32:47 +01:00
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