about summary refs log tree commit diff
path: root/src/libcore/mem.rs
AgeCommit message (Collapse)AuthorLines
2019-02-18Auto merge of #58373 - RalfJung:maybe-uninit, r=gnzlbgbors-8/+0
update stdsimd and remove now-unused MaybeUninit::into_inner That's a huge diff for stdsimd... Cc @gnzlbg @alexcrichton
2019-02-16Rollup merge of #58468 - RalfJung:maybe-uninit-split, r=Centrilkennytm-27/+49
split MaybeUninit into several features, expand docs a bit This splits the `maybe_uninit` feature gate into several: * `maybe_uninit` for what we will hopefully stabilize soon-ish. * `maybe_uninit_ref` for creating references into `MaybeUninit`, for which the rules are not yet clear. * `maybe_uninit_slice` for handling slices of `MaybeUninit`, which needs more API design work. * `maybe_uninit_array` for creating arrays of `MaybeUninit` using a macro (because we don't have https://github.com/rust-lang/rust/issues/49147 yet). Is that an okay thing to do? The goal is to help people avoid APIs we do not want to stabilize yet. I used this to make sure rustc itself does not use `get_ref` and `get_mut`. I also extended the docs to advise against uninitialized integers -- again this is something for which the rules are still being discussed.
2019-02-14split MaybeUninit into several features, expand docs a bitRalf Jung-27/+49
2019-02-14remove MaybeUninit::into_innerRalf Jung-8/+0
2019-02-14Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnikMazdak Farrokhzad-1/+1
Convert old first edition links to current edition one r? @steveklabnik
2019-02-13Convert old doc links to current editionLzu Tao-1/+1
Use footnote style to bypass the tidy check
2019-02-10libs: doc commentsAlexander Regueiro-20/+24
2019-02-10tests: doc commentsAlexander Regueiro-2/+2
2019-02-10Auto merge of #58129 - RalfJung:maybe-uninit, r=cramertjbors-7/+53
MaybeUninit: some docs, rename into_inner -> into_initialized, return &mut from set
2019-02-10it is okay not to use into_innerRalf Jung-0/+1
2019-02-07Rollup merge of #57848 - jrvanwhy:transmute-export-doc, r=QuietMisdreavusGuillaume Gomez-0/+1
Generate a documentation page for core::mem::transmute. In `#[no_std]` environments, `std::mem::transmute` is unavailable. Searching for "core transmute" online only pulls up `core::intrinsics::transmute`, which is behind the (unstable) `core_intrinsics` feature flag. Users wishing to use transmute in `#[no_std]` environments typically should use `core::mem::transmute` instead, as it is stable. This documentation makes `core::mem::transmute` discoverable.
2019-02-06fix doctestsRalf Jung-1/+2
2019-02-05fix doctestRalf Jung-2/+2
2019-02-04typosRalf Jung-2/+2
2019-02-03make set return a mutable referenceRalf Jung-1/+4
2019-02-03expand as_[mut_]ptr docs a bitRalf Jung-4/+4
2019-02-03some type-level docs for MaybeUninit; rename into_inner -> into_initializedRalf Jung-2/+43
2019-01-28rename first_mut_ptr -> first_ptr_mutRalf Jung-1/+1
2019-01-28fix typos, improve docsRalf Jung-2/+2
2019-01-28libcore: avoid mem::uninitialized and raw ptr castsRalf Jung-0/+14
2019-01-27Auto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichtonbors-3/+0
Bump bootstrap compiler to 1.33 beta r? @alexcrichton or @pietroalbini cc @rust-lang/release
2019-01-26Remove lexical scope examples from std::mem::dropAlex Macleod-28/+1
The example no longer produces an error in the 2018 edition
2019-01-26Bump bootstrap compiler to 1.33 betaMark Rousskov-3/+0
2019-01-24Instead of adding a paragraph mentioning std::mem::transmute and ↵Johnathan Van Why-0/+1
core::mem::transmute, create documentation pages for them. This renders them discoverable via search. I removed the mention of the exports in the transmute documentation, but can re-add it if desired.
2019-01-21un-deprecate mem::zeroedRalf Jung-1/+0
2018-12-27panic when calling MaybeUninhabited::into_inner on uninhabited typeRalf Jung-0/+6
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-23Rollup merge of #56970 - Firstyear:mem_uninit_doc_ptr_drop, r=Manishearthkennytm-0/+39
Mem uninit doc ptr drop Extend the mem::uninitialized documentation to account for partially initialized arrays and how to correctly handle these. These are used in some datastructures (trees for example) or in FFI. r? @Manishearth
2018-12-19Fix tidy errorWilliam Brown-1/+2
2018-12-19Updates based on commentWilliam Brown-8/+4
2018-12-19Extend documentation for mem uninit to discuss partial allocation of the valuesWilliam Brown-0/+42
2018-12-17deny intra-doc link resolution failures in libstdAndy Russell-0/+3
2018-12-12Bump to 1.33.0Alex Crichton-1/+0
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-12-02let FIXME refer to tracking issueRalf Jung-1/+1
2018-11-28put the MaybeUninit inside the UnsafeCellRalf Jung-3/+0
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+6
2018-11-23use more inlining, and force some of itRalf Jung-4/+13
2018-11-22Rollup merge of #55485 - petertodd:2018-10-manuallydrop-deref, r=TimNNGuillaume Gomez-2/+2
Return &T / &mut T in ManuallyDrop Deref(Mut) impl Without this change the generated documentation looks like this: fn deref(&self) -> &<ManuallyDrop<T> as Deref>::Target Returning the actual type directly makes the generated docs more clear: fn deref(&self) -> &T Basically, compare how the impl for `Box<T>` and `ManuallyDrop<T>` looks in this screenshot: ![rust docs for ManuallyDrop as Deref](https://user-images.githubusercontent.com/7042/47673083-fc9dc280-db89-11e8-89b0-c6bde663feef.png)
2018-11-21update various stdlib docsSteve Klabnik-10/+5
2018-11-15Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichtonPietro Albini-0/+13
Add mem::forget_unsized() for forgetting unsized values ~~Allows passing values of `T: ?Sized` types to `mem::drop` and `mem::forget`.~~ Adds `mem::forget_unsized()` that accepts `T: ?Sized`. I had to revert the PR that removed the `forget` intrinsic and replaced it with `ManuallyDrop`: https://github.com/rust-lang/rust/pull/40559 We can't use `ManuallyDrop::new()` here because it needs `T: Sized` and we don't have support for unsized return values yet (will we ever?). r? @eddyb
2018-11-13Auto merge of #55052 - newpavlov:patch-2, r=alexcrichtonbors-1/+1
Use read_unaligned instead of read in transmute_copy Closes: #55044 This change could result in performance regression on non-x86 platforms. (but it also can fix some of UB which lurks in existing programs) An alternative would be to update `transmute_copy` documentation with alignment requirements.
2018-11-12Auto merge of #55278 - Centril:constification-1, r=alexcrichtonbors-2/+1
Minor standard library constification This PR makes some bits of the standard library into `const fn`s. I've tried to be as aggressive as I possibly could in the constification. The list is rather small due to how restrictive `const fn` is at the moment. r? @oli-obk cc @rust-lang/libs Stable public APIs affected: + [x] `Cell::as_ptr` + [x] `UnsafeCell::get` + [x] `char::is_ascii` + [x] `iter::empty` + [x] `ManuallyDrop::{new, into_inner}` + [x] `RangeInclusive::{start, end}` + [x] `NonNull::as_ptr` + [x] `{[T], str}::as_ptr` + [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}` + [x] `CStr::as_ptr` + [x] `Ipv4Addr::is_unspecified` + [x] `Ipv6Addr::new` + [x] `Ipv6Addr::octets` Unstable public APIs affected: + [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}` + [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}` + [x] `core::convert::identity` -------------------------- ## Removed from list in first pass: Stable public APIs affected: + [ ] `BTree{Map, Set}::{len, is_empty}` + [ ] `VecDeque::is_empty` + [ ] `String::{is_empty, len}` + [ ] `FromUtf8Error::utf8_error` + [ ] `Vec<T>::{is_empty, len}` + [ ] `Layout::size` + [ ] `DecodeUtf16Error::unpaired_surrogate` + [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}` + [ ] `panic::Location::{file, line, column}` + [ ] `{ChunksExact, RChunksExact}::remainder` + [ ] `Utf8Error::valid_up_to` + [ ] `VacantEntry::key` + [ ] `NulError::nul_position` + [ ] `IntoStringError::utf8_error` + [ ] `IntoInnerError::error` + [ ] `io::Chain::get_ref` + [ ] `io::Take::{limit, get_ref}` + [ ] `SocketAddrV6::{flowinfo, scope_id}` + [ ] `PrefixComponent::{kind, as_os_str}` + [ ] `Path::{ancestors, display}` + [ ] `WaitTimeoutResult::timed_out` + [ ] `Receiver::{iter, try_iter}` + [ ] `thread::JoinHandle::thread` + [ ] `SystemTimeError::duration` Unstable public APIs affected: + [ ] `core::fmt::Arguments::new_v1` + [ ] `core::fmt::Arguments::new_v1_formatted` + [ ] `Pin::{get_ref, into_ref}` + [ ] `Utf8Lossy::chunks` + [ ] `LocalWaker::as_waker` + [ ] `panic::PanicInfo::{internal_constructor, message, location}` + [ ] `panic::Location::{internal_constructor }` ## Removed from list in 2nd pass: Stable public APIs affected: + [ ] `LinkedList::{new, iter, is_empty, len}` + [ ] `mem::forget` + [ ] `Cursor::{new, get_ref, position}` + [ ] `io::{empty, repeat, sink}` + [ ] `PoisonError::new` + [ ] `thread::Builder::new` + [ ] `process::Stdio::{piped, inherit, null}` Unstable public APIs affected: + [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12Update docsStjepan Glavina-16/+3
2018-11-12Add forget_unsized onlyStjepan Glavina-107/+15
2018-11-10Fix documentation typos.Bruce Mitchener-4/+4
2018-11-10revert some more constification.Mazdak Farrokhzad-1/+1
2018-11-10constify parts of libcore.Mazdak Farrokhzad-3/+2
2018-11-08Allow unsized types in mem::drop and mem::forgetStjepan Glavina-1/+119
2018-10-31Bump nightly to 1.32.0Alex Crichton-11/+2
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations