rust/library/core/src/slice
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
..
iter Warn on unused doc(hidden) on trait impl items 2022-05-08 22:53:14 +02:00
ascii.rs Make some usize-typed masks definition agnostic to the size of usize 2022-04-15 17:04:59 +02:00
cmp.rs make memcmp return a value of c_int_width instead of i32 2022-04-02 17:21:08 -07:00
index.rs Fix a mistake in SliceIndex's documentation 2022-05-24 13:22:41 -04:00
iter.rs Rollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm 2022-08-12 20:39:10 +05:30
memchr.rs Make some usize-typed masks definition agnostic to the size of usize 2022-04-15 17:04:59 +02:00
mod.rs Rollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcm 2022-08-21 16:54:07 +02:00
raw.rs Partially stabilize const_slice_from_raw_parts 2022-07-09 23:20:02 +02:00
rotate.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
sort.rs Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
specialize.rs Remove size_of == 1 case from fill specialization. 2021-08-09 19:25:28 +02:00