Commit Graph

62 Commits

Author SHA1 Message Date
Tim Diekmann
8725e4c337 Add support for custom allocators in Vec 2020-11-18 19:34:19 +01:00
Yuki Okushi
39f8289e38 Rollup merge of #77969 - ryan-scott-dev:bigo-notation-consistency, r=m-ou-se
Doc formating consistency between slice sort and sort_unstable, and big O notation consistency

Updated documentation for slice sorting methods to be consistent between stable and unstable versions, which just ended up being minor formatting differences.

I also went through and updated any doc comments with big O notation to be consistent with #74010 by italicizing them rather than having them in a code block.
2020-10-23 18:26:26 +09:00
Ryan Scott
000ec5e2f8 Made slice sort documentation consistent between stable and unstable versions 2020-10-15 23:21:14 +11:00
dylni
1ff7da6551 Move slice::check_range to RangeBounds 2020-09-18 12:17:51 -04:00
Tyler Mandry
23a677787e Rollup merge of #75026 - JulianKnodt:array_windows, r=Amanieu
Add array_windows fn

This mimicks the functionality added by array_chunks, and implements a const-generic form of
`windows`. It makes egregious use of `unsafe`, but by necessity because the array must be
re-interpreted as a slice of arrays, and unlike array_chunks this cannot be done by casting the
original array once, since each time the index is advanced it needs to move one element, not
`N`.

I'm planning on adding more tests, but this should be good enough as a premise for the functionality.
Notably: should there be more functions overwritten for the iterator implementation/in general?

~~I've marked the issue as #74985 as there is no corresponding exact issue for `array_windows`, but it's based of off `array_chunks`.~~

Edit: See Issue #75027 created by @lcnr for tracking issue

~~Do not merge until I add more tests, please.~~

r? @lcnr
2020-09-16 12:24:03 -07:00
kadmin
f240abc1dc Add array window fn
Updated issue to #75027

Update to rm oob access

And hopefully fix docs as well

Fixed naming conflict in test

Fix test which used 1-indexing

Nth starts from 0, woops

Fix a bunch of off by 1 errors

See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a

Add even more off by 1 errors

And also write `next` and `next_back` in terms of `nth` and `nth_back`.

Run fmt

Fix forgetting to change fn name in test

add nth_back test & document unsafe

Remove as_ref().unwrap()
Documented occurrences of unsafe, noting what invariants are maintained
2020-09-16 14:52:20 +00:00
Ralf Jung
c528d24196 fix slice::check_range aliasing problems 2020-09-15 23:14:41 +02:00
Josh Stone
864a28e01d Re-export ArrayChunksMut in alloc 2020-09-04 19:51:29 -07:00
LeSeulArtichaut
1ababd8794 Use intra-doc-links in alloc 2020-08-21 00:25:25 +02:00
Bastian Kauschke
d51b71a35a add tracking issue 2020-08-01 07:49:24 +02:00
Bastian Kauschke
95fa63e63f liballoc export ArrayChunks 2020-07-30 10:50:35 +02:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00