rust/library/alloc/src
Matthias Krüger a45f69f27d
Rollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcm
Replace most uses of `pointer::offset` with `add` and `sub`

As PR title says, it replaces `pointer::offset` in compiler and standard library with `pointer::add` and `pointer::sub`. This generally makes code cleaner, easier to grasp and removes (or, well, hides) integer casts.

This is generally trivially correct, `.offset(-constant)` is just `.sub(constant)`, `.offset(usized as isize)` is just `.add(usized)`, etc. However in some cases we need to be careful with signs of things.

r? ````@scottmcm````

_split off from #100746_
2022-08-21 16:54:07 +02:00
..
alloc Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
boxed Rollup merge of #98585 - cuviper:covariant-thinbox, r=thomcc 2022-07-01 20:19:17 +05:30
collections Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
ffi Make some docs nicer wrt pointer offsets 2022-08-21 02:22:20 +04:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
sync add some Miri-only tests 2022-08-18 18:07:39 -04:00
vec Rollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcm 2022-08-21 16:54:07 +02:00
alloc.rs Adjust cfgs 2022-08-12 16:28:15 -04:00
borrow.rs Intra-doc-link-ify reference to Clone::clone_from 2022-07-08 22:47:07 +02:00
boxed.rs add #[must_use] to Box::from_raw 2022-07-15 17:05:50 +09:00
fmt.rs remove useless cold 2022-05-29 20:40:56 +01:00
lib.rs Auto merge of #100810 - matthiaskrgr:rollup-xep778s, r=matthiaskrgr 2022-08-20 20:08:26 +00:00
macros.rs update cfg(bootstrap)s 2022-07-01 15:48:23 +02:00
raw_vec.rs alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
rc.rs Use byte_sub in [a]rc impl 2022-07-10 15:16:51 +04:00
slice.rs Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
str.rs Expose Utf8Lossy as Utf8Chunks 2022-08-20 12:49:20 -04:00
string.rs Rollup merge of #99544 - dylni:expose-utf8lossy, r=Mark-Simulacrum 2022-08-20 19:32:07 +02:00
sync.rs Use byte_sub in [a]rc impl 2022-07-10 15:16:51 +04:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00