about summary refs log tree commit diff
path: root/src/libcore/mem.rs
AgeCommit message (Collapse)AuthorLines
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
2018-10-29Return &T / &mut T in ManuallyDrop Deref(Mut) implPeter Todd-2/+2
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
2018-10-28Rollup merge of #55421 - CAD97:patch-1, r=kennytmkennytm-0/+20
Add ManuallyDrop::take Tracking issue: #55422 Proposed in this form in https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679, see that thread for some history. A small convenience wrapper for `ManuallyDrop` that makes a pattern (taking ownership of the contained data in drop) more obvious.
2018-10-28Add ManuallyDrop::takeChristopher Durham-0/+20
https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679
2018-10-21Add MaybeUninit::newSimon Sapin-0/+9
Sometimes it *is* initialized!
2018-10-13Use read_unaligned instead of read in transmute_copyArtyom Pavlov-1/+1
Closes: #55044 This change could result in performance regression on non-x86 platforms. Alternative would be to update `transmute_copy` with alignment requirements.
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-0/+2
2018-09-30Auto merge of #54596 - mjbshaw:drop, r=RalfJungbors-0/+10
Make core::mem::needs_drop a const fn This fixes #51929.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-28/+0
2018-09-26Gate const core::mem::needs_drop behind const_needs_dropMichael Bradshaw-0/+1
2018-09-26Make core::mem::needs_drop a const fnMichael Bradshaw-0/+9
2018-09-22don't deprecate mem::{uninitialized,zeroed} just yetJorge Aparicio-2/+3
2018-09-22add MaybeUninit and deprecate mem::{uninitialized,zeroed}Jorge Aparicio-0/+95
2018-09-04Clarify `ManuallyDrop` docsTobias Bucher-2/+8
Mention that you can use `into_inner` to drop the contained value.