Commit Graph

78 Commits

Author SHA1 Message Date
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
Mazdak Farrokhzad
b768328242 Rollup merge of #67174 - kraai:remove-checked_add, r=rkruppe
Remove `checked_add` in `Layout::repeat`
2019-12-11 10:10:47 +01:00
Yuki Okushi
9af3eec9a6 Rollup merge of #67154 - kraai:alloc-typos, r=Dylan-DPC
Fix typos in src/libcore/alloc.rs docs
2019-12-11 04:33:00 +09:00
Tyler Mandry
196ca9dc94 Rollup merge of #67155 - kraai:move-instead-of-binding-to-reference, r=cramertj
Move `Layout`s instead of binding by reference
2019-12-09 14:33:13 -08:00
Matthew Kraai
a983e0590a Remove checked_add in Layout::repeat 2019-12-09 06:49:37 -08:00
Matthew Kraai
4ea7bb8f12 Move Layouts instead of binding by reference 2019-12-08 08:36:22 -05:00
Matthew Kraai
9e8505d79e Change "attributes" to "attribute" in Alloc's docs 2019-12-08 08:21:27 -05:00
Matthew Kraai
cca954eb22 Change "alloc/realloc" to "realloc/dealloc" 2019-12-08 08:21:27 -05:00
Matthew Kraai
b2392fddab Add "this" to GlobalAlloc::alloc's docs 2019-12-08 08:21:27 -05:00
Matthew Kraai
852be72c43 Change "though" to "through" in Alloc's docs 2019-12-08 08:21:27 -05:00
Matthew Kraai
76d3003d4c Change "result" to "resulting" in Layout::extend's docs 2019-12-08 08:21:27 -05:00
Matthew Kraai
2b2b16c2a4 Simplify Layout::extend_packed 2019-12-07 21:23:21 -05:00
Mazdak Farrokhzad
fd78173484 Rollup merge of #67092 - kraai:us-to-is, r=jonas-schievink
Fix comment typos in src/libcore/alloc.rs
2019-12-06 23:27:05 +01:00
Matthew Kraai
292b998c64 Change "wth" to "with" in Layout::padding_needed_for comment 2019-12-06 07:59:13 -08:00
Matthew Kraai
a3c85770fb Change "us" to "is" in Layout::for_value comment 2019-12-06 07:35:30 -08:00
Matthew Kraai
0c4bc58cee Change "either" to "any" in Layout::from_size_align's docs 2019-12-06 07:06:03 -08:00
Christopher Durham
d1e53da809 Clarify Layout::pad_to_align safety comment 2019-11-25 16:39:24 -05:00
Christopher Durham
6773064b05 Remove unsafe in Layout::pad_to_align 2019-11-25 16:05:33 -05:00
Christopher Durham
b9da350b09 Fix typo
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-09 18:28:41 -05:00
Christopher Durham
183e61b661 Fix Layout::pad_to_align type mismatch 2019-11-09 15:28:32 -05:00
Christopher Durham
fd3594b9ee Layout::pad_to_align is infallible 2019-11-09 15:19:09 -05:00
Oliver Scherer
02f9167f94 Have tidy ensure that we document all unsafe blocks in libcore 2019-11-06 11:04:42 +01:00
Mateusz Mikuła
f93032c818 Fix clippy::clone_on_copy warnings 2019-07-18 15:14:56 +02:00
Guillaume Gomez
4c1332afd9 Add missing links for CannotReallocInPlace type 2019-07-09 16:21:59 +02:00
Mazdak Farrokhzad
9389c69415 Rollup merge of #60947 - blkerby:global_alloc_typo, r=jonas-schievink
Fix typos in docs of GlobalAlloc
2019-05-19 02:31:46 +02:00
Brent Kerby
86cda2d48e Fix typos in docs of GlobalAlloc 2019-05-18 16:22:59 -06:00
Richard Wiedenhöft
a7a05203f1 Mark core::alloc::Layout::from_size_align_unchecked const 2019-05-14 09:40:10 +02:00
Mazdak Farrokhzad
dbfbadeac4 libcore: deny more... 2019-04-19 01:37:12 +02:00
Taiki Endo
360432f1e8 libcore => 2018 2019-04-18 14:47:35 +09:00
Mazdak Farrokhzad
4ca865e929 heading # Unsafety => # Safety in stdlib docs. 2019-02-25 08:01:35 +01:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
Pietro Albini
17ae50765e Rollup merge of #55844 - waywardmonkeys:typo-fixes, r=varkor
Fix documentation typos.
2018-11-11 00:21:25 +01:00
Bruce Mitchener
9b4d68e53b Fix documentation typos. 2018-11-10 19:31:49 +07:00
Murarth
317f494c72 Fix Rc/Arc allocation layout
* Rounds allocation layout up to a multiple of alignment
* Adds a convenience method `Layout::pad_to_align` to perform rounding
2018-11-08 11:50:02 -07:00
Amanieu d'Antras
02d50de63e Add a tracking issue for extra Layout methods 2018-11-06 20:36:43 +00:00
Amanieu d'Antras
de027b64f1 API changes as discussed in the comments 2018-11-06 17:21:13 +00:00
Amanieu d'Antras
94f3ce9def Add a comment about how Layout::extend matches the C struct layout 2018-11-06 17:21:13 +00:00
Matthias Krüger
4972beaf65 fix typos in various places 2018-10-23 15:56:25 +02:00
ljedrz
1667950d73 Remove explicit returns where unnecessary 2018-08-04 14:31:03 +02:00
Mark Rousskov
683a3db01f Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
Simon Sapin
239ec7d2dc Implement #[alloc_error_handler]
This to-be-stable attribute is equivalent to `#[lang = "oom"]`.
It is required when using the alloc crate without the std crate.
It is called by `handle_alloc_error`, which is in turned called
by "infallible" allocations APIs such as `Vec::push`.
2018-07-09 23:13:24 +02:00
Simon Sapin
b0547cea0a Move core::alloc::CollectionAllocErr to alloc::collections 2018-06-29 14:01:33 +02:00
Simon Sapin
1565fc2120 Document that Layout::from_size_align does not allow align=0
This was already implied since zero is not a power of two, but maybe
worth pointing out.
2018-06-27 15:07:42 +02:00
Simon Sapin
2b789bd057 Rename OOM to allocation error
The acronym is not descriptive unless one has seen it before.

* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`

Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
2018-06-18 21:41:24 +02:00
Simon Sapin
7f0d54d988 More alloc docs tweaks 2018-06-11 13:48:57 -07:00
Simon Sapin
9dcb64f346 Alloc docs teaks 2018-06-11 13:48:57 -07:00
Simon Sapin
bbaff036e7 Stablize the GlobalAlloc trait
Fixes https://github.com/rust-lang/rust/issues/49668
2018-06-11 13:48:39 -07:00
Simon Sapin
77606f20c9 Stabilize alloc::Layout (with only some of its methods) 2018-06-11 13:48:33 -07:00